Skip to content
Orvanov0.2.0

invalid_refresh_token

HTTP status: 401 · Code: invalid_refresh_token

The refresh token is malformed, reused, or its session has ended or expired; sign in again.

The refresh token is malformed, was already used, or its session has ended or expired. A refresh token works once; using an old one again also ends the session, in case it was stolen.

Sign the user in again. If you see this often, check that two places in your app aren’t refreshing the same session at once with the same token. The SDKs coordinate refreshes for you.

Every SDK throws one error type for a failed call. Match on its code, which is always invalid_refresh_token for this error, never on the message.

import { ErrorCode, OrvanoError } from '@orvano/js'
try {
// your Orvano call
} catch (error) {
if (error instanceof OrvanoError && error.code === ErrorCode.invalidRefreshToken) {
// handle invalid_refresh_token
} else {
throw error
}
}

The error also carries the HTTP status (401), a message, and a request ID. Quote the request ID when you report a problem: the server logs it with the failure. See Errors for how errors work in every SDK, or every error code.