Support cred auto-login.

This commit is contained in:
Yang Luo
2021-05-16 18:18:55 +08:00
parent 338c589e51
commit 18806f07a8
6 changed files with 55 additions and 23 deletions

View File

@ -67,7 +67,7 @@ func checkPassword(user *User, password string) string {
return "password incorrect"
}
} else if organization.PasswordType == "salt" {
if getSaltedPassword(password, organization.PasswordSalt) == user.Password {
if password == user.Password || getSaltedPassword(password, organization.PasswordSalt) == user.Password {
return ""
} else {
return "password incorrect"