Issue with Sending Email to signIn Function for Storing in DB #11878
Unanswered
azamshaikh1103
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm encountering an issue with NextAuth and would appreciate any guidance or support.
Problem
I am using NextAuth for authentication in my application. I want users to stay logged in with Google and also be able to connect multiple social platforms. My goal is to store the access_token of other platforms using user's email address in my database when they sign in, regardless of the provider they use. And the email is being fetched from the session after user login with google.
Current Implementation
Here is how I am currently attempting to handle the sign-in process:
Page.tsx
nextauth page:
Issue
The email field is sometimes coming as undefined, and I’m not sure if it’s being handled correctly by the signIn function or if I’m missing something in the configuration.
Expected Behavior
Users should be able to stay logged in with Google.
Users should be able to connect multiple social platforms.
The email address of the user should be sent to the signIn function and stored in the database.
Beta Was this translation helpful? Give feedback.
All reactions