mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-24 05:33:40 +09:00
fix: use clearer message for ldap auth failure (#39392)
* fix #34942 log: `user does not exist ...: not in LDAP database or invalid password`
This commit is contained in:
@@ -31,8 +31,8 @@ func (source *Source) Authenticate(ctx context.Context, user *user_model.User, u
|
||||
}
|
||||
sr := source.SearchEntry(loginName, password, source.AuthSource.Type == auth.DLDAP)
|
||||
if sr == nil {
|
||||
// User not in LDAP, do nothing
|
||||
return nil, user_model.ErrUserNotExist{Name: loginName}
|
||||
// User is not in LDAP database, or password is invalid (direct bind)
|
||||
return nil, user_model.ErrUserNotExist{Name: loginName, ExtraMsg: "not in LDAP database or invalid password"}
|
||||
}
|
||||
// Fallback.
|
||||
// FIXME: this fallback would cause problems when the "Username" attribute is not set and a user inputs their email.
|
||||
|
||||
Reference in New Issue
Block a user