-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Destructuring profile to allow override default fields #961
Conversation
* add provider: Microsoft * documentation * support no tenant setup * fix code style * chore: rename Microsoft provider to AzureADB2C * chore: alphabetical order in providers/index
…" (nextauthjs#919) This reverts commit 6e6a24a.
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/nextauthjs/next-auth/4ht3b45zc |
Good point, I think I came to the same conclusion in #959, I didn't really understand why we don't propagate everything, but @iaincollins may have a reasoning here. Although in the same file, on line 185 you can see we return the whole profile as well. Did you check if the info you need is available there in the jwt callback? |
Yup, I've checked Anyway, looks like my PR will not solve this problem, bc I see there are several places where this behaviour with predefined fields is hardcoded, sorry. |
Feature: This change will allow adjusting provider options to get more information about accounts.
What and Why:
For example: By default, Facebook provider configured only to accept
clientId
andclientSecret
, but if we want to fetch, link to the profile we need to adjust those options with the followingscope: 'email user_link',
andprofileUrl: 'https://graph.facebook.com/me?fields=email,name,picture,link',
. And then after the user is going to log in, we miss additional info from options because of hardcoded part at https://github.com/nextauthjs/next-auth/blob/canary/src/server/lib/oauth/callback.js#L172I suggest a destructuring of profile object to override the default fields.
Checklist:
This change will not introduce new behaviour or functionality except for extended possibilities.