Support cred manager for organization.MasterPassword

This commit is contained in:
Yang Luo
2021-12-22 20:56:22 +08:00
parent d6c2d0f3e8
commit b95f107a60
2 changed files with 13 additions and 2 deletions

View File

@ -107,8 +107,10 @@ func CheckPassword(user *User, password string) string {
credManager := cred.GetCredManager(organization.PasswordType)
if credManager != nil {
if organization.MasterPassword != "" && organization.MasterPassword == password {
return ""
if organization.MasterPassword != "" {
if credManager.IsPasswordCorrect(password, organization.MasterPassword, "", organization.PasswordSalt) {
return ""
}
}
if credManager.IsPasswordCorrect(password, user.Password, user.PasswordSalt, organization.PasswordSalt) {