Can we use native auth settings? #26
Unanswered
ecan-dearx
asked this question in
Q&A
Replies: 2 comments 2 replies
-
Looks like this setting causes problems with this plugin. This requires
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Yes, you can. But the problem is that the user requires a There are 3 possible solutions for this: 1. Make username optional:auth: {
loginWithUsername: {
allowEmailLogin: true,
requireEmail: true,
requireUsername: false, // <-- Make it optional
},
}, 2. Extend your Auth.js profile from your provider:providers: [
github({
async profile(profile, tokens) {
return {
// Default fields from github provider
...(await github({}).profile!(profile, tokens)),
// Custom fields
username: profile.login, // <-- Add username field
};
},
}),
], More information about extending your session can be found in the Auth.js documentation. 3. Set a default value for the username field:fields: [
{
name: "username",
type: "text",
defaultValue: () => crypto.randomUUID(), // <-- Generate a random uuid or something else
},
], |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Can we use the following settings now local strategies can be used?
Beta Was this translation helpful? Give feedback.
All reactions