GODT-2246: do not report API error 422 when using an invalid email address.

This commit is contained in:
Xavier Michelon
2023-01-12 12:21:00 +01:00
parent c3eb6b2dbf
commit 8d9db83a87
3 changed files with 4 additions and 4 deletions

View File

@ -407,7 +407,7 @@ func (s *Service) Login(ctx context.Context, login *LoginRequest) (*emptypb.Empt
_ = s.SendEvent(NewLoginAlreadyLoggedInEvent(auth.UserID))
} else if apiErr := new(proton.Error); errors.As(err, &apiErr) {
switch apiErr.Code { // nolint:exhaustive
case proton.PasswordWrong:
case proton.PasswordWrong, proton.UsernameInvalid:
_ = s.SendEvent(NewLoginError(LoginErrorType_USERNAME_PASSWORD_ERROR, ""))
case proton.PaidPlanRequired: