fix(auth): update provider id on sign in
This commit is contained in:
@@ -169,6 +169,15 @@ export async function githubCallback(
|
||||
},
|
||||
},
|
||||
});
|
||||
} else if (existingUser.provider === 'github') {
|
||||
await db.account.update({
|
||||
where: {
|
||||
id: existingUser.id,
|
||||
},
|
||||
data: {
|
||||
providerId: String(githubUserId),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
setSessionTokenCookie(
|
||||
@@ -371,6 +380,15 @@ export async function googleCallback(
|
||||
},
|
||||
},
|
||||
});
|
||||
} else if (existingAccount.provider === 'google') {
|
||||
await db.account.update({
|
||||
where: {
|
||||
id: existingAccount.id,
|
||||
},
|
||||
data: {
|
||||
providerId: googleId,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
setSessionTokenCookie(
|
||||
|
||||
Reference in New Issue
Block a user