downstream: improve SASL error logging

This commit is contained in:
Simon Ser 2023-06-01 11:37:03 +02:00
parent 40a40566f4
commit c8d5c90d9d

View File

@ -666,6 +666,7 @@ func (dc *downstreamConn) handleMessageUnregistered(ctx context.Context, msg *ir
}
if err = auth.AuthPlain(ctx, dc.srv.db, username, password); err != nil {
err = fmt.Errorf("%v (username %q)", err, username)
break
}
case "OAUTHBEARER":
@ -681,7 +682,7 @@ func (dc *downstreamConn) handleMessageUnregistered(ctx context.Context, msg *ir
}
if credentials.oauthBearer.Username != "" && credentials.oauthBearer.Username != username {
err = fmt.Errorf("username mismatch (server returned %q)", username)
err = fmt.Errorf("username mismatch (client provided %q, but server returned %q)", credentials.oauthBearer.Username, username)
break
}
default: