Improve dc.authenticate()'s error messages
This commit is contained in:
parent
7bfa4dafef
commit
943182de2f
@ -775,7 +775,7 @@ func (dc *downstreamConn) authenticate(username, password string) error {
|
|||||||
|
|
||||||
u, err := dc.srv.db.GetUser(username)
|
u, err := dc.srv.db.GetUser(username)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
dc.logger.Printf("failed authentication for %q: %v", username, err)
|
dc.logger.Printf("failed authentication for %q: user not found: %v", username, err)
|
||||||
return errAuthFailed
|
return errAuthFailed
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -786,7 +786,7 @@ func (dc *downstreamConn) authenticate(username, password string) error {
|
|||||||
|
|
||||||
err = bcrypt.CompareHashAndPassword([]byte(u.Password), []byte(password))
|
err = bcrypt.CompareHashAndPassword([]byte(u.Password), []byte(password))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
dc.logger.Printf("failed authentication for %q: %v", username, err)
|
dc.logger.Printf("failed authentication for %q: wrong password: %v", username, err)
|
||||||
return errAuthFailed
|
return errAuthFailed
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user