mirror of
https://github.com/h44z/wg-portal.git
synced 2025-08-25 14:31:14 +00:00
fix ldap provider, disable gin logs by default
This commit is contained in:
@@ -86,7 +86,7 @@ func (provider Provider) Login(ctx *authentication.AuthContext) (string, error)
|
||||
}
|
||||
|
||||
if len(sr.Entries) != 1 {
|
||||
return "", errors.Wrapf(err, "invalid amount of ldap entries (%d)", len(sr.Entries))
|
||||
return "", errors.Errorf("invalid amount of ldap entries (%d)", len(sr.Entries))
|
||||
}
|
||||
|
||||
userDN := sr.Entries[0].DN
|
||||
@@ -97,11 +97,11 @@ func (provider Provider) Login(ctx *authentication.AuthContext) (string, error)
|
||||
switch provider.config.Type {
|
||||
case ldapconfig.TypeActiveDirectory:
|
||||
if ldapconfig.IsActiveDirectoryUserDisabled(uac) {
|
||||
return "", errors.Wrapf(err, "user is disabled")
|
||||
return "", errors.New("user is disabled")
|
||||
}
|
||||
case ldapconfig.TypeOpenLDAP:
|
||||
if ldapconfig.IsOpenLdapUserDisabled(uac) {
|
||||
return "", errors.Wrapf(err, "user is disabled")
|
||||
return "", errors.New("user is disabled")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user