Verifies a refresh token and returns its decoded payload.
Called in the /api/auth/refresh route after checking the token exists in the database and has not expired.
/api/auth/refresh
The raw JWT string from the refreshToken cookie
refreshToken
Decoded AccessTokenPayload
AccessTokenPayload
JsonWebTokenError if the token is malformed or has an invalid signature
JsonWebTokenError
TokenExpiredError if the token has expired
TokenExpiredError
const payload = verifyRefreshToken(cookieToken) Copy
const payload = verifyRefreshToken(cookieToken)
Verifies a refresh token and returns its decoded payload.
Called in the
/api/auth/refreshroute after checking the token exists in the database and has not expired.