mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
Don't encrypt user pass when user.PasswordType is non-empty when adding users
This commit is contained in:
parent
6715efd781
commit
669ac7c618
@ -627,12 +627,10 @@ func AddUser(user *User) (bool, error) {
|
|||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if user.PasswordType == "" && organization.PasswordType != "" {
|
if user.PasswordType == "" || user.PasswordType == "plain" {
|
||||||
user.PasswordType = organization.PasswordType
|
user.UpdateUserPassword(organization)
|
||||||
}
|
}
|
||||||
|
|
||||||
user.UpdateUserPassword(organization)
|
|
||||||
|
|
||||||
err = user.UpdateUserHash()
|
err = user.UpdateUserHash()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user