Open kratess opened 8 months ago
In my repository i put
return {
test: "test",
banner: profile.banner,
id: profile.id,
name: profile.username,
email: profile.email,
image: profile.image_url,
}
but it doesn't return it.
So i figured out u need to do it like
providers: [
Discord({
clientId: process.env.DISCORD_CLIENT_ID ?? "",
clientSecret: process.env.DISCORD_CLIENT_SECRET ?? "",
authorization: "https://discord.com/api/oauth2/authorize?scope=identify+guilds",
profile: (profile) => {
...
return {
...
};
}
}),
],
but I still cant add more fields, even the original code doesn't provide all of the fields it should, like user id
Same here this provider can't be overide and the user id as not returned
Add async :
providers: [
Discord({
clientId: process.env.DISCORD_CLIENT_ID ?? "",
clientSecret: process.env.DISCORD_CLIENT_SECRET ?? "",
authorization: "https://discord.com/api/oauth2/authorize?scope=identify+guilds",
async (profile) => {
...
return {
...
};
}
}),
],
Provider type
Discord
Environment
System: OS: Windows 10 10.0.19045 Memory: 4.51 GB / 15.96 GB Binaries: Node: 20.10.0 - C:\Program Files\nodejs\node.EXE npm: 10.2.3 - C:\Program Files\nodejs\npm.CMD pnpm: 8.6.0 - ~\AppData\Roaming\npm\pnpm.CMD Browsers: Edge: Chromium (122.0.2365.52) Internet Explorer: 11.0.19041.3636 npmPackages: next: latest => 14.1.0 next-auth: beta => 5.0.0-beta.13 react: ^18.2.0 => 18.2.0
Reproduction URL
https://github.com/kratess/next-auth-example
Describe the issue
I followed the docs https://next-auth.js.org/providers/discord and overrided the return of the profile in order to return more info. Even the default id is not returned. So maybe there is something missing.
How to reproduce
override discord provider and see. it is not working
Expected behavior
Overrided profile info