Skip to main content

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/refresh Uses the refreshToken cookie to issue a new access token and refresh token. Both cookies are updated on success.

Request

Cookies

refreshToken
string
required
The refresh token stored in the refreshToken HTTP-only cookie. This is set automatically by the browser after a successful login or previous token refresh.
No request body is required.

Response

success
boolean
Whether the request succeeded.
data
object

Cookies updated

On success, both cookies are replaced with new values:
CookieDescription
accessTokenNew short-lived JWT.
refreshTokenNew long-lived refresh token. Expires after 7 days.

Examples

curl --request POST \
  --url https://your-api.example.com/api/v1/auth/refresh \
  --cookie 'refreshToken=v1.MRjY...'

Success response (200)

{
  "success": true,
  "data": {
    "user": {
      "id": "b3e1c2d4-...",
      "email": "user@example.com",
      "emailVerified": true,
      "provider": "email",
      "createdAt": "2024-01-15T10:30:00.000Z",
      "updatedAt": "2024-01-15T10:30:00.000Z"
    },
    "tokens": {
      "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
      "refreshToken": "v1.XkZp...",
      "expiresIn": 3600
    }
  }
}

Errors

HTTP statusCodeDescription
401UNAUTHORIZEDThe refreshToken cookie is missing, invalid, or expired. The user must log in again.

Build docs developers (and LLMs) love