forked from Silverfish/proton-bridge
GODT-2246: do not report API error 422 when using an invalid email address.
This commit is contained in:
@ -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:
|
||||
|
||||
Reference in New Issue
Block a user