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

Co-authored-by: Shivam Kalra <[email protected]>
This commit is contained in:
Somay ChauhanandShivam Kalra authored and GitHub committed 2023-09-15 12:57:41 +00:00
1 parent abc077bfb6
commit ab39c8f581
1 file changed
+3 -1
@@ -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);
}