fix: a new email can signin with any password once it's invited to a team (#11359)

Co-authored-by: Shivam Kalra <shivamkalra98@gmail.com>
This commit is contained in:
Somay Chauhan
2023-09-15 12:57:41 +00:00
committed by GitHub
co-authored by Shivam Kalra
parent abc077bfb6
commit ab39c8f581
@@ -143,7 +143,9 @@ const providers: Provider[] = [
if (user.identityProvider !== IdentityProvider.CAL && !credentials.totpCode) {
throw new Error(ErrorCode.ThirdPartyIdentityProviderEnabled);
}
if (!user.password && user.identityProvider == IdentityProvider.CAL) {
throw new Error(ErrorCode.IncorrectEmailPassword);
}
if (!user.password && user.identityProvider !== IdentityProvider.CAL && !credentials.totpCode) {
throw new Error(ErrorCode.IncorrectEmailPassword);
}