downstream: improve SASL error logging
This commit is contained in:
parent
40a40566f4
commit
c8d5c90d9d
@ -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 {
|
if err = auth.AuthPlain(ctx, dc.srv.db, username, password); err != nil {
|
||||||
|
err = fmt.Errorf("%v (username %q)", err, username)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
case "OAUTHBEARER":
|
case "OAUTHBEARER":
|
||||||
@ -681,7 +682,7 @@ func (dc *downstreamConn) handleMessageUnregistered(ctx context.Context, msg *ir
|
|||||||
}
|
}
|
||||||
|
|
||||||
if credentials.oauthBearer.Username != "" && credentials.oauthBearer.Username != username {
|
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
|
break
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user