Skip to content

Couldn't figure out how to pass data between callbacks #1491

Answered by balazsorban44
D2Mat asked this question in Help
Discussion options

You must be logged in to vote

So I feel you have way overengineered what you were trying to achieve, here is my suggestion (Please note I haven't tested/run the code anywhere, there might be some small issues, but the main ideas remain the same). I'll try to explain everything below.

export default NextAuth({
  debug: true,
  providers: [
    Providers.LinkedIn({
      clientId: process.env.LINKEDIN_CLIENT_ID,
      clientSecret: process.env.LINKEDIN_CLIENT_SECRET,
      async profile(profile, tokens) {
        return {
          email: await getEmail(tokens.accessToken),
          image: await getImage(tokens.accessToken),
          id: profile.id,
          localizedLastName: profile.localizedLastName,
          loc…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@D2Mat
Comment options

@balazsorban44
Comment options

@D2Mat
Comment options

@balazsorban44
Comment options

Answer selected by D2Mat
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