#NextAuth - how to get more info about the session?

5 messages · Page 1 of 1 (latest)

honest escarp
#

Background: i use progressive scope enhancement to sign in the user with google, then get access to their gmail, then auth into their github accounts

how do i get something like:

    google: {
      provider: google,
      email: [email protected],
      image: https://xxx,
      scope: profile
    },
    gmail: {
      provider: gmail,
      email: [email protected],
      image: https://xxx,
      scope: gmail.send
    },
    github: {
      provider: github,
      userid: fotoflo,
      image: https://xxx,
    }
   ]
  }
```?
#

or at least a callback when each auth is completed so i can know which one is complete?

#
  callbacks: {
    session: async (session) => {
      session.id = session.user.id;
      session.externalAccounts = await getAllAccounts(session.user.id);
      return Promise.resolve(session);
    },
  },
#

oh that was an easy one

#

i solved it before 🙂