Skip to content

Commit

Permalink
try automatically adding empty name
Browse files Browse the repository at this point in the history
  • Loading branch information
jchaselubitz committed Dec 13, 2023
1 parent 168881b commit 2f61486
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pages/api/auth/next-auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ const options: AuthOptions = {
// newUser: '/welcome',
},
callbacks: {
async signIn({ user, account, profile, email, credentials }) {
if (account?.provider === 'email' && !user.name) {
user.name = ''; // Set default name as empty string
}
return true;
},
//@ts-ignore
async jwt({
token,
Expand Down

0 comments on commit 2f61486

Please sign in to comment.