Skip to content
Discussion options

You must be logged in to vote

I think you can get your providerAccountId in the profile or account object in the JWT callback and then pass it to the session like this:

callback: {
  async session(session, token) {
      session.providerAccountId = token.providerAccountId 
      return session
  },
  async jwt(token, user, account, profile, isNewUser) {
    if (profile?.id) {
        token.providerAccountId = profile.id
    }
      return token
  }
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@satoufuyuki
Comment options

Answer selected by satoufuyuki
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants