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 signing in with the GitHub provider using Auth.js (next-auth), after the OAuth flow completes, the user is redirected to http://localhost:3000/api/auth/callback/github?code=CODE (I got a 404 error page there) and not to the default root page (/).
How to reproduce
Set up a Next.js app with the following dependencies:
After signing in, the user should be redirected back to the app (root), as no custom redirects/middlewares were defined.
The text was updated successfully, but these errors were encountered:
Mordai
added
bug
Something isn't working
triage
Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
labels
Jan 17, 2025
Yeah, I tried it (it builds without any errors/warnings), but the same behaviour after running the built application: redirect to a 404 [...]/callback URL.
Mordai
changed the title
Redirect to 404 "/api/auth/callback/github?code=" after authorization
Redirect to 404 "/api/auth/callback/github?code=" after authentication
Jan 19, 2025
Environment
Reproduction URL
https://github.com/Mordai/yt-directory
Describe the issue
When signing in with the GitHub provider using Auth.js (
next-auth
), after the OAuth flow completes, the user is redirected to http://localhost:3000/api/auth/callback/github?code=CODE (I got a 404 error page there) and not to the default root page (/
).How to reproduce
auth.ts
file):Create a
route.ts
file inapp/api/auth/[...nextauth]
folder with the content:My
.env.local
file:signIn
function on a page:Observe the redirection sequence:
After a successfull authentication, you'll be redirected to http://localhost:3000/api/auth/callback/github?code=CODE and see a 404 page.
Expected behavior
After signing in, the user should be redirected back to the app (root), as no custom redirects/middlewares were defined.
The text was updated successfully, but these errors were encountered: