忘记密码以后,重设二步验证设定

pull/765/head
日下部 詩 4 years ago committed by GitHub
parent 4b4acda24f
commit c5ac10b11c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save