mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-01 01:50:20 +08:00
feat: fix LDAP user password checking logic in GetOAuthToken() (#1975)
This commit is contained in:
@ -628,7 +628,12 @@ func GetPasswordToken(application *Application, username string, password string
|
||||
ErrorDescription: "the user does not exist",
|
||||
}, nil
|
||||
}
|
||||
msg := CheckPassword(user, password, "en")
|
||||
var msg string
|
||||
if user.Ldap != "" {
|
||||
msg = checkLdapUserPassword(user, password, "en")
|
||||
} else {
|
||||
msg = CheckPassword(user, password, "en")
|
||||
}
|
||||
if msg != "" {
|
||||
return nil, &TokenError{
|
||||
Error: InvalidGrant,
|
||||
|
Reference in New Issue
Block a user