mirror of
https://github.com/h44z/wg-portal.git
synced 2025-09-19 00:51:13 +00:00
improve logging of LDAP login process (#529)
This commit is contained in:
@@ -364,6 +364,7 @@ func (a *Authenticator) passwordAuthentication(
|
|||||||
}
|
}
|
||||||
ldapUserInfo, err = ldapAuth.ParseUserInfo(rawUserInfo)
|
ldapUserInfo, err = ldapAuth.ParseUserInfo(rawUserInfo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
slog.Error("failed to parse ldap user info", "identifier", identifier, "error", err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -376,10 +377,13 @@ func (a *Authenticator) passwordAuthentication(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if userSource == "" {
|
if userSource == "" {
|
||||||
|
slog.Warn("no user source found for user", "identifier", identifier, "ldapProviderCount", a.ldapAuthenticators)
|
||||||
return nil, errors.New("user not found")
|
return nil, errors.New("user not found")
|
||||||
}
|
}
|
||||||
|
|
||||||
if userSource == domain.UserSourceLdap && ldapProvider == nil {
|
if userSource == domain.UserSourceLdap && ldapProvider == nil {
|
||||||
|
slog.Warn("no ldap provider found for user",
|
||||||
|
"identifier", identifier, "ldapProviderCount", a.ldapAuthenticators)
|
||||||
return nil, errors.New("ldap provider not found")
|
return nil, errors.New("ldap provider not found")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user