CAL-1053: Invalidate password to avoid once Google auth is used to merge accounts (#7152)
* CAL-1053: Invalidate password to avoid once Google auth is used to merge accounts * remove log
This commit is contained in:
1 parent
2698cde311
commit
2c54ea90f9
1 file changed
+4
@@ -507,6 +507,10 @@ export default NextAuth({
|
|||||||
existingUserWithEmail.identityProvider === IdentityProvider.CAL &&
|
existingUserWithEmail.identityProvider === IdentityProvider.CAL &&
|
||||||
(idP === IdentityProvider.GOOGLE || idP === IdentityProvider.SAML)
|
(idP === IdentityProvider.GOOGLE || idP === IdentityProvider.SAML)
|
||||||
) {
|
) {
|
||||||
|
await prisma.user.update({
|
||||||
|
where: { email: existingUserWithEmail.email },
|
||||||
|
data: { password: null },
|
||||||
|
});
|
||||||
return true;
|
return true;
|
||||||
} else if (existingUserWithEmail.identityProvider === IdentityProvider.CAL) {
|
} else if (existingUserWithEmail.identityProvider === IdentityProvider.CAL) {
|
||||||
return "/auth/error?error=use-password-login";
|
return "/auth/error?error=use-password-login";
|
||||||
|
|||||||
Reference in new issue
Block a user