Back to Better Auth

invalid_code

docs/content/docs/reference/errors/invalid_code.mdx

1.6.9302 B
Original Source

This error occurs when the authentication code is invalid, expired, or cannot be verified.

How to fix

  • Restart the authentication flow to generate a new code
  • Ensure the code is used only once and within its valid time window
  • Verify that the correct code is being sent to the callback endpoint