Open fotoflo opened 2 years ago
I too am hitting this issue, albeit with the Apple provider.
@fotoflo I managed to resolve this by changing the cookies
config option to:
sessionToken: {
name: `__Secure-next-auth.session-token`,
options: {
httpOnly: false,
sameSite: false,
path: "/",
secure: true,
},
},
Environment
Run env: System: OS: macOS 12.1 CPU: (8) arm64 Apple M1 Memory: 108.56 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 16.15.0 - ~/.nvm/versions/node/v16.15.0/bin/node Yarn: 1.22.18 - ~/.nvm/versions/node/v16.15.0/bin/yarn npm: 8.5.5 - ~/.nvm/versions/node/v16.15.0/bin/npm Browsers: Chrome: 102.0.5005.115 Safari: 15.2 npmPackages: next: 12.1.6 => 12.1.6 next-auth: 4.5.0 => 4.5.0 react: 18.2.0 => 18.2.0
Reproduction URL
https://github.com/fotoflo/gapi-firebase-next
Describe the issue
Im trying to link a second account and get the token 1) the user signs up / signs in with google. A user account is created on Firestore and minimal info is passed to the useSession hook
2) The logged in user now signs in to github - im trying to add their token to the database - i use the sign in callback as below. They do it twice. The first time the user.id comes from github (an 8 digit number). the second time it comes from the database (a 20 char string)
Im hoping that we get the 20 char string every time...
How to reproduce
pull the d20577142408ff3d02db805ce7c78e22b2aa6e70 commit from https://github.com/fotoflo/gapi-firebase-next
Expected behavior
the user from the database should coem through should come through as user, and the account from the oauth provider should come through. both , every time