You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When sign-in fails during the OAuth callback, NextAuth redirects /auth/login?error=<code>, but the login page ignores the error query param and renders the normal "Sign in with GitHub" card. The user ends up back where they started with no indication anything went wrong; the only signal is an Auth error line in the server logs.
NextAuth sends these errors to the sign-in page rather than /auth/error: OAuthSignin, OAuthCallback, OAuthCreateAccount, Callback, OAuthAccountNotLinked, SessionRequired, and Default.
To Reproduce
Set NEXTAUTH_URL to a URL other than the one you browse from (e.g. a tunnel URL, while opening http://localhost:3000)
Click Sign in with GitHub and authorize
The server logs OAUTH_CALLBACK_ERROR … State cookie was missing
The browser lands on /auth/login?error=OAuthCallback showing the normal login card, with no error
Expected behavior
The login page shows an error message (e.g. an ErrorFlash above the login card) when error is present, with a short user-facing message per error code and a generic fallback, so users know to retry or contact an admin.
Screenshots
No response
Additional context
src/app/auth/login/page.tsx reads the session but never reads searchParams.error
src/app/auth/error/page.tsx has the same problem in the other direction: it always shows "Access denied", whatever the error code
The existing ErrorFlash component (src/app/components/flash/ErrorFlash.tsx) could display the message
Activity