SMQ-3159 - Return specific error on non-existent user during login (#3160)
Continuous Delivery / Build and Push (push) Has been cancelled
Check the consistency of generated files / check-generated-files (push) Has been cancelled
Check License Header / check-license (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled

Signed-off-by: Arvindh <arvindh91@gmail.com>
This commit is contained in:
Arvindh
2025-10-01 22:21:50 +05:30
committed by GitHub
parent 04774ae972
commit 6c77e1b738
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ var (
ErrDomainAuthorization = errors.New("failed to perform authorization over the domain")
// ErrLogin indicates wrong login credentials.
ErrLogin = errors.New("invalid user id or secret")
ErrLogin = errors.New("invalid credentials")
// ErrMalformedEntity indicates a malformed entity specification.
ErrMalformedEntity = errors.New("malformed entity specification")
+4
View File
@@ -182,6 +182,10 @@ func (svc service) IssueToken(ctx context.Context, identity, secret string) (*gr
dbUser, err = svc.users.RetrieveByEmail(ctx, identity)
}
if err == repoerr.ErrNotFound {
return &grpcTokenV1.Token{}, errors.Wrap(svcerr.ErrLogin, err)
}
if err != nil {
return &grpcTokenV1.Token{}, errors.Wrap(svcerr.ErrAuthentication, err)
}