Documentation Index
Fetch the complete documentation index at: https://mintlify.com/eggarcia98/auth-backend/llms.txt
Use this file to discover all available pages before exploring further.
POST /api/v1/auth/validate-token
Checks whether the current session is valid. The endpoint first tries to verify the access token. If that fails, it attempts to use the refresh token to issue new tokens. Use this endpoint to silently refresh sessions without requiring the user to log in again.
Request
No request body is required.Headers
Bearer token for authentication. Format:
Bearer <accessToken>. Optional — the access token can also be supplied via the accessToken cookie.Cookies
The access token cookie set after login. Used as a fallback if the
Authorization header is not provided.The refresh token cookie set after login. Used to issue new tokens if the access token is invalid or expired.
Token resolution order
- Access token from
Authorization: Bearer <token>header. - Access token from the
accessTokencookie. - If the access token is missing or invalid, the
refreshTokencookie is used to issue new tokens.
Response
Whether the request succeeded.
Either
"Token is valid" or "Token refreshed successfully".Cookies updated on refresh
If the access token was expired and a refresh occurred, both cookies are updated:| Cookie | Description |
|---|---|
accessToken | New short-lived JWT. |
refreshToken | New long-lived refresh token. Expires after 7 days. |
Examples
Success response — valid token (200)
Success response — token refreshed (200)
Errors
| HTTP status | Code | Description |
|---|---|---|
401 | UNAUTHORIZED | No tokens were provided, or both the access token and refresh token are invalid or expired. The user must log in again. |
500 | INTERNAL_ERROR | An unexpected error occurred during token validation. |