🔐 Authentication
Refresh token
The Refresh Access Token API is responsible for refreshing the access token when it expires.
It allows you to make a request to this endpoint with the refresh token, which has a lengthy expiry time, to obtain a new access token.
Simultaneously, the API sets the new access token in a cookie for future authentication purposes while replacing the expired one.
This functionality ensures continuous access to protected resources by automatically renewing the access token without requiring the user to reauthenticate manually.
By utilizing the refresh token, the API securely refreshes the access token and updates it in the cookie, ensuring seamless and uninterrupted access to authorized endpoints.
post/users/refresh-token
Response
Refresh token
Example response
{
"data": {
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NDc2ZTM0ZWJlMWNmYjljYzA4YmQ0NDYiLCJlbWFpbCI6IndhamUuc2h1YmhhbTExMUBnbWFpbC5jb20iLCJ1c2VybmFtZSI6IndhamVzaHViaGFtIiwicm9sZSI6IlVTRVIiLCJpYXQiOjE2ODU1NjMyMjEsImV4cCI6MTY4NTY0OTYyMX0.o6vbC9qrMHV_FfQNFZX3h053eOHvBgbl0iQJSB5NeNc",
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NDc2ZTM0ZWJlMWNmYjljYzA4YmQ0NDYiLCJpYXQiOjE2ODU1NjMyMjEsImV4cCI6MTY4NjQyNzIyMX0.TJpj8-2qU__GI_dKDdrHwQvUWCFSFXCfgOuV6MV05UI"
},
"message": "Access token refreshed",
"statusCode": 200,
"success": true
}