mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-02 03:00:18 +08:00
feat: support resetting password on first login (#2980)
* feat: support reset password in first login * feat: disable needUpdatePassword when user haven't email and phone and mfa
This commit is contained in:
@ -510,7 +510,9 @@ func (c *ApiController) SetPassword() {
|
||||
}
|
||||
|
||||
targetUser.Password = newPassword
|
||||
_, err = object.SetUserField(targetUser, "password", targetUser.Password)
|
||||
targetUser.NeedUpdatePassword = false
|
||||
|
||||
_, err = object.UpdateUser(userId, targetUser, []string{"password", "need_update_password"}, false)
|
||||
if err != nil {
|
||||
c.ResponseError(err.Error())
|
||||
return
|
||||
|
Reference in New Issue
Block a user