client: differentiate error vs. nil result
When calling manager.Authenticate, logs now show different error messages.
This commit is contained in:
parent
cdcf08066d
commit
42cd59aef4
1 changed files with 7 additions and 1 deletions
|
@ -168,7 +168,13 @@ func (m *ClientManager) SetDexAdmin(clientID string, isAdmin bool) error {
|
||||||
|
|
||||||
func (m *ClientManager) Authenticate(creds oidc.ClientCredentials) (bool, error) {
|
func (m *ClientManager) Authenticate(creds oidc.ClientCredentials) (bool, error) {
|
||||||
clientSecret, err := m.clientRepo.GetSecret(nil, creds.ID)
|
clientSecret, err := m.clientRepo.GetSecret(nil, creds.ID)
|
||||||
if err != nil || clientSecret == nil {
|
if err != nil {
|
||||||
|
log.Errorf("error getting secret for client ID: %v: err: %v", creds.ID, err)
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if clientSecret == nil {
|
||||||
|
log.Errorf("no secret found for client ID: %v", creds.ID)
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue