feat: fix LDAP user password checking logic in GetOAuthToken() (#1975)

This commit is contained in:
XDTD 2023-06-15 21:04:09 +08:00 committed by GitHub
parent 7058a34f87
commit cc456f265f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,