## 1. Token lifetime configuration

- [x] 1.1 Add a `token_lifetime` section to `config/support.php` holding, per scope (`admin`, `employee`), the access-token lifetime in minutes and the refresh-token lifetime in days, defaulting to 30 and 3 and overridable by env.
- [x] 1.2 In `AuthServiceProvider::boot()`, call `Passport::tokensExpireIn()` and `Passport::refreshTokensExpireIn()` with the configured values.
- [x] 1.3 Add a feature test asserting that a password-grant login issues an access token expiring in 30 minutes and a refresh token expiring in 3 days.
- [x] 1.4 Add a feature test asserting that an access token is accepted immediately after issuance and rejected once expired.
- [x] 1.5 Add a feature test asserting that `admin` and `employee` logins produce identical lifetimes.

## 2. Refresh behaviour

- [x] 2.1 Add a feature test asserting that `grant_type=refresh_token` returns both a new access token and a new refresh token.
- [x] 2.2 Add a feature test asserting that the presented refresh token and its access token both stop working after the refresh.
- [x] 2.3 Add a feature test asserting that the new refresh token's expiry is 3 days from the refresh, not inherited from the token it replaces.
- [x] 2.4 Add a feature test asserting that a refresh token unused for more than 3 days is rejected.

## 3. Logout endpoint

- [x] 3.1 Add `logout()` to `AuthController`: read the authenticated access token's id, mark it revoked, and mark revoked every `oauth_refresh_tokens` row whose `access_token_id` matches it.
- [x] 3.2 Register `POST /api/v1/logout` behind the `auth:api` middleware in `routes/v1/api.php`.
- [x] 3.3 Add OpenAPI/Scribe annotations for the endpoint, matching the style of the surrounding `AuthController` methods.
- [x] 3.4 Add a feature test asserting that after logout the access token is rejected and the refresh token yields no new token.
- [x] 3.5 Add a feature test asserting that logging out on one device leaves a second device's token working.
- [x] 3.6 Add a feature test asserting that logging out twice rejects the second call cleanly (the route sits behind auth:api, so the already-revoked token is rejected before the controller runs), and that logout without a valid token is rejected.

## 4. Revocation covers refresh tokens

- [x] 4.1 Extend `Account::revokeTokens()` to revoke the refresh tokens belonging to the access tokens it revokes, keeping its existing `$exceptIds` and `$scope` filtering and its current signature.
- [x] 4.2 Extend `Account::revokeTokensByAccountIds()` the same way.
- [x] 4.3 Add a feature test asserting that after a password reset a previously issued refresh token yields no new access token.
- [x] 4.4 Add a feature test asserting that after an administrator deactivates an account, refreshing is rejected.
- [x] 4.5 Add a feature test for scope-limited revocation: revoking `admin` leaves the `employee` token and its refresh token working.
- [x] 4.6 Add a feature test for the excepted-token path: the preserved access token and its refresh token keep working while the account's others are revoked.

## 5. Authentication error codes

- [x] 5.1 Override `unauthenticated()` in `app/Http/Middleware/Authenticate.php` to return 401 with `{error, message}`: `token_expired` when the bearer token parses as a JWT whose `exp` has passed, `token_invalid` otherwise. Decode for classification only; never treat the result as authentication.
- [x] 5.2 In `AuthController@login`, return `session_expired` instead of the blanket `invalid_credentials` when a `grant_type=refresh_token` request is rejected.
- [x] 5.3 Add the four error codes and messages to the language files alongside the existing `auth.*` entries.
- [x] 5.4 Add a feature test covering each code: expired token, revoked token, missing/malformed token, rejected refresh, wrong password.
- [x] 5.5 Add a feature test asserting that a forged token with a past `exp` yields `token_expired` and is still unauthorized.

## 6. Deploy and documentation

- [x] 6.1 Add an artisan command (or documented one-off step) that revokes all rows in `oauth_access_tokens` and then `oauth_refresh_tokens`, to be run once at deploy.
- [x] 6.2 Record in the deploy notes that the front-end release must land in the same window, and that every user will be logged out once.
- [x] 6.3 Run the full feature suite in the `app` container with `DB_HOST=db` and confirm no regressions beyond the pre-existing `ExampleTest` failure.
