MSP-1071 add error to admin login in controller

This commit is contained in:
john committed 2022-10-12 09:12:38 +03:00
1 parent f90f21ebef
commit 56e38174bf
1 file changed
+2
+2
View File
@@ -82,6 +82,8 @@ func (a Auth) Login(ctx context.Context, authRequest domain.LoginRequest) (*doma
case errors.Is(err, domain.ErrUnauthenticated):
a.logger.Error(ctx, err.Error())
return nil, status.Error(codes.Unauthenticated, "invalid credential")
case errors.Is(err, domain.ErrTooManyLoginRequests):
return nil, status.Error(codes.ResourceExhausted, "too many requests")
case err != nil:
return nil, errors.WithMessage(err, "login")
default: