From 56e38174bfec704e73cc963f109b45b12d29f2cb Mon Sep 17 00:00:00 2001 From: john Date: Tue, 11 Oct 2022 15:06:40 +0300 Subject: [PATCH] MSP-1071 add error to admin login in controller --- controller/auth.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/controller/auth.go b/controller/auth.go index 5528ef1..f71dda9 100644 --- a/controller/auth.go +++ b/controller/auth.go @@ -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: