feat: fix bug in SetPassword() API (#3296)

This commit is contained in:
DacongDA 2024-10-18 20:50:43 +08:00 committed by GitHub
parent 95e8bdcd36
commit 94e6b5ecb8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -494,7 +494,12 @@ func (c *ApiController) SetPassword() {
c.ResponseError(c.T("general:Missing parameter"))
return
}
if userId != c.GetSession("verifiedUserId") {
c.ResponseError(c.T("general:Wrong userId"))
return
}
c.SetSession("verifiedCode", "")
c.SetSession("verifiedUserId", "")
}
targetUser, err := object.GetUser(userId)

View File

@ -533,5 +533,6 @@ func (c *ApiController) VerifyCode() {
}
c.SetSession("verifiedCode", authForm.Code)
c.SetSession("verifiedUserId", user.GetId())
c.ResponseOk()
}