mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 20:50:19 +08:00
feat: Add bcrypt encrypted password type (#386)
* Add loading and countdown status to the verification code sending button
* Add bcrypt encrypted password type
* Revert "Add loading and countdown status to the verification code sending button"
This reverts commit 782b9e229a
.
* Update bcrypt.go
* Update go.sum
This commit is contained in:
@ -111,8 +111,7 @@ func CheckPassword(user *User, password string) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
sealedPassword := credManager.GetSealedPassword(password, user.PasswordSalt, organization.PasswordSalt)
|
||||
if user.Password == sealedPassword {
|
||||
if credManager.IsPasswordCorrect(password, user.Password, user.PasswordSalt, organization.PasswordSalt) {
|
||||
return ""
|
||||
}
|
||||
return "password incorrect"
|
||||
|
@ -33,7 +33,7 @@ func (user *User) UpdateUserHash() {
|
||||
func (user *User) UpdateUserPassword(organization *Organization) {
|
||||
credManager := cred.GetCredManager(organization.PasswordType)
|
||||
if credManager != nil {
|
||||
sealedPassword := credManager.GetSealedPassword(user.Password, user.PasswordSalt, organization.PasswordSalt)
|
||||
user.Password = sealedPassword
|
||||
hashedPassword := credManager.GetHashedPassword(user.Password, user.PasswordSalt, organization.PasswordSalt)
|
||||
user.Password = hashedPassword
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user