忘记密码以后,重设二步验证设定
This commit is contained in:
parent
4b4acda24f
commit
c5ac10b11c
1 changed files with 4 additions and 1 deletions
|
@ -62,7 +62,10 @@ func (service *UserResetService) Reset(c *gin.Context) serializer.Response {
|
|||
if err := user.Update(map[string]interface{}{"password": user.Password}); err != nil {
|
||||
return serializer.DBErr("无法重设密码", err)
|
||||
}
|
||||
|
||||
// 重设二步验证设定
|
||||
if err := user.Update(map[string]interface{}{"two_factor": ""}); err != nil {
|
||||
return serializer.DBErr("无法更新二步验证设定", err)
|
||||
}
|
||||
cache.Deletes([]string{fmt.Sprintf("%d", uid)}, "user_reset_")
|
||||
return serializer.Response{}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue