Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get additional scope data using next-auth?

I am using next-auth with discord authentication, I added the guilds to my scope but I am not able to get the guild data, how can this be done?

const options = {
  providers: [
    Providers.Discord({
      clientId: process.env.DISCORD_CLIENT_ID,
      clientSecret: process.env.DISCORD_CLIENT_SECRET,
      scope: "identify guilds",
    }),
  ],
};

1 Answers

Most recent build lets you override any pattern (deeply merged so that you only have to type the fields you wish to update).

Came here looking for this exact answer, and this is what I used:

DiscordProvider({
  clientId: process.env.DISCORD_CLIENT_ID,
  clientSecret: process.env.DISCORD_CLIENT_SECRET,
  authorization: { params: { scope: 'identify guilds' } },
}),
like image 54
BadPirate Avatar answered Sep 04 '25 09:09

BadPirate



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!