Change the lifetimes in the guard settings.
Refresh a session
POST /auth/{guard}/refresh — API key only, no Bearer token.
access_token and refresh_token), the same shape as login.
When to refresh
- Proactively: shortly before
expires_inruns out. - Reactively: when a request returns
401, refresh once and retry.
Log out
POST /auth/{guard}/logout — needs the Bearer token. Revokes one refresh token (this device).
Log out everywhere
POST /auth/{guard}/logout-all — needs the Bearer token. Revokes all of the user’s refresh tokens.
Logout revokes refresh tokens. Access tokens are stateless and stay valid until they expire (15 minutes by default). Keep
jwt_ttl short, and delete tokens from the client on logout.What ends a session
Storing tokens
Never log tokens or put them in URLs.
