Skip to main content

errors

AdapterError​

Todo​

One of the database Adapter methods failed.

Extends​

  • AuthError

AuthorizedCallbackError​

Todo​

Extends​

  • AuthError

CallbackRouteError​

This error occurs when the user cannot finish the sign-in process. Depending on the provider type, this could have happened for multiple reasons.

tip

Check out [auth][details] in the error message to know which provider failed.

Example​

[auth][details]: { "provider": "github" }

For an OAuth provider, possible causes are:

  • The user denied access to the application
  • There was an error parsing the OAuth Profile: Check out the provider's profile or userinfo.request method to make sure it correctly fetches the user's profile.
  • The signIn or jwt callback methods threw an uncaught error: Check the callback method implementations.

For an Email provider, possible causes are:

  • The provided email/token combination was invalid/missing: Check if the provider's sendVerificationRequest method correctly sends the email.
  • The provided email/token combination has expired: Ask the user to log in again.
  • There was an error with the database: Check the database logs.

For a Credentials provider, possible causes are:

  • The authorize method threw an uncaught error: Check the provider's authorize method.
  • The signIn or jwt callback methods threw an uncaught error: Check the callback method implementations.
tip

Check out [auth][cause] in the error message for more details. It will show the original stack trace.

Extends​

  • AuthError

ErrorPageLoop​

Todo​

Extends​

  • AuthError

EventError​

Todo​

Extends​

  • AuthError

InvalidCallbackUrl​

Todo​

Extends​

  • AuthError

InvalidCheck​

Todo​

Extends​

  • AuthError

InvalidEndpoints​

Todo​

Extends​

  • AuthError

JWTSessionError​

Todo​

Extends​

  • AuthError

MissingAPIRoute​

Todo​

Extends​

  • AuthError

MissingAdapter​

Todo​

Extends​

  • AuthError

MissingAdapterMethods​

Todo​

Extends​

  • AuthError

MissingAuthorize​

Todo​

Extends​

  • AuthError

MissingSecret​

Auth.js requires a secret to be set, but none was not found. This is used to encrypt cookies, JWTs and other sensitive data.

note

If you are using a framework like Next.js, we try to automatically infer the secret from the AUTH_SECRET environment variable. Alternatively, you can also explicitly set the AuthConfig.secret.

tip

You can generate a good secret value:

  • On Unix systems: type openssl rand -hex 32 in the terminal
  • Or generate one online

Extends​

  • AuthError

OAuthAccountNotLinked​

Todo​

Thrown when an Email address is already associated with an account but the user is trying an OAuth account that is not linked to it.

Extends​

  • AuthError

OAuthCallbackError​

Thrown when an OAuth provider returns an error during the sign in process. This could happen for example if the user denied access to the application or there was a configuration error.

For a full list of possible reasons, check out the specification Authorization Code Grant: Error Response

Extends​

  • AuthError

OAuthCreateUserError​

Todo​

Extends​

  • AuthError

OAuthProfileParseError​

This error occurs during an OAuth sign in attempt when the provdier's response could not be parsed. This could for example happen if the provider's API changed, or the OAuth2Config.profile method is not implemented correctly.

Extends​

  • AuthError

SessionTokenError​

Todo​

Extends​

  • AuthError

SignInError​

This error occurs when the user cannot initiate the sign-in process. Depending on the provider type, this could have happened for multiple reasons.

tip

Check out [auth][details] in the error message to know which provider failed.

Example​

[auth][details]: { "provider": "github" }

For an OAuth provider, possible causes are:

  • The Authorization Server is not compliant with the OAuth 2.0 specifcation Check the details in the error message.
  • A runtime error occurred in Auth.js. This should be reported as a bug.

For an Email provider, possible causes are:

  • The email sent from the client is invalid, could not be normalized by EmailConfig.normalizeIdentifier
  • The provided email/token combination has expired: Ask the user to log in again.
  • There was an error with the database: Check the database logs.

Extends​

  • AuthError

SignOutError​

Todo​

Extends​

  • AuthError

UnknownAction​

Auth.js was requested to handle an operation that it does not support.

See AuthAction for the supported actions.

Extends​

  • AuthError

UnsupportedStrategy​

Todo​

Extends​

  • AuthError

UntrustedHost​

Todo​

Extends​

  • AuthError

Verification​

The user's email/token combination was invalid. This could be because the email/token combination was not found in the database, or because it token has expired. Ask the user to log in again.

Extends​

  • AuthError