Skip to content

Commit

Permalink
Generic alpha log error message for failed ACL login (#6848)
Browse files Browse the repository at this point in the history
* In case of an invalid login request, a generic error message will be printed in alpha logs

* used x.ErrorInvalidLogin per Ibrahim's suggestion

(cherry picked from commit 7088d59)
  • Loading branch information
OmarAyo committed Nov 5, 2020
1 parent 8b392da commit a8fefdc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions edgraph/access_ee.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func (s *Server) authenticateLogin(ctx context.Context, request *api.LoginReques

if user == nil {
return nil, errors.Errorf("unable to authenticate through refresh token: "+
"user not found for id %v", userId)
"invalid username or password")
}

glog.Infof("Authenticated user %s through refresh token", userId)
Expand All @@ -152,10 +152,10 @@ func (s *Server) authenticateLogin(ctx context.Context, request *api.LoginReques

if user == nil {
return nil, errors.Errorf("unable to authenticate through password: "+
"user not found for id %v", request.Userid)
"invalid username or passowrd")
}
if !user.PasswordMatch {
return nil, errors.Errorf("password mismatch for user: %v", request.Userid)
return nil, x.ErrorInvalidLogin
}
return user, nil
}
Expand Down

0 comments on commit a8fefdc

Please sign in to comment.