From 943182de2ffae042bdde6076e4a80023da035683 Mon Sep 17 00:00:00 2001 From: Hubert Hirtz Date: Wed, 25 Nov 2020 13:40:55 +0100 Subject: [PATCH] Improve dc.authenticate()'s error messages --- downstream.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/downstream.go b/downstream.go index 3ee0cf7..5b6ad3e 100644 --- a/downstream.go +++ b/downstream.go @@ -775,7 +775,7 @@ func (dc *downstreamConn) authenticate(username, password string) error { u, err := dc.srv.db.GetUser(username) 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 } @@ -786,7 +786,7 @@ func (dc *downstreamConn) authenticate(username, password string) error { err = bcrypt.CompareHashAndPassword([]byte(u.Password), []byte(password)) 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 }