SynqDocs
Errors

Sign-in error code invalid_grant

What Synq's `invalid_grant` sign-in error code means, why a sign-in came back to the app with it, and what to do.

The sign-in's one-time code expired or was used already, often by a second tab or a page loaded twice. At the token endpoint, its error_description says which: the code expired (it lasts a minute), was used already, isn't this app's, or the redirect_uri or PKCE code_verifier isn't the one the sign-in started with; or a refresh token expired, was used already or its sign-in ended.

What to do

Sign in again. When the description names the redirect_uri or the code_verifier, the app's team sends exactly the ones the sign-in started with.

What the person sees

This sign-in expired or was already used. Sign in again.

A sign-in that doesn't finish comes back to the app with a code instead of a session. Synq's SDKs hand it over as the error's code, invalid_grant, and @synqauth/nextjs puts it in the page's address as synq_error=invalid_grant and says the words above (signInErrorMessage). Branch on the code, never on the words.

See every error code. Still stuck? Support says where to write, what to send and where Synq's status page is.

On this page