Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

newUser page is always called even if user is not new on Google or Facebook Login #10890

Open
seaver-choy opened this issue May 12, 2024 · 1 comment
Labels
bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.

Comments

@seaver-choy
Copy link

seaver-choy commented May 12, 2024

Environment

OS: Mac Sonoma 14.4.1
Node: 21.7.3
"next": "14.0.3",
"next-auth": "^4.24.5",
"@next-auth/mongodb-adapter": "^1.1.3",

Reproduction URL

https://github.com/callbackph/callback-sample-repository/blob/master/auth.ts

Describe the issue

  1. Declared a page for new-user with Google OR Facebook Login with expectation that it only gets called when sign up.
pages: {
    signIn: '/register',
    verifyRequest: '/auth/verify-request',
    newUser: '/auth/new-user',
  },
  1. using await signIn the first time, user document gets created, get redirected to newUser page.
  2. Logout
  3. using await signIn calls STILL go to newUser page when using Google or Facebook Login

How to reproduce

  1. Use Sign In on OAuth Providers ✅
  2. Redirect to newUser Page ✅
  3. Logout ✅
  4. Resign In with OAuth Providers, newUser page is still redirected to. ❌

Expected behavior

  1. Use Sign in on OAuth Providers
  2. Redirect to newUser page
  3. Logout
  4. Resign In with OAuth Providers, newUser page is NOT redirected to.
@seaver-choy seaver-choy added bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime. labels May 12, 2024
@ndom91
Copy link
Member

ndom91 commented May 19, 2024

Unfortunately I can't reproduce this with the example app.

Could you try to put together a minimal reproduction? 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
Projects
None yet
Development

No branches or pull requests

3 participants
@ndom91 @seaver-choy and others