mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-08 00:50:28 +08:00
feat: add forbidden check in SetPassword()
This commit is contained in:
@ -473,6 +473,11 @@ func (c *ApiController) SetPassword() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if targetUser.IsForbidden || targetUser.IsDeleted {
|
||||||
|
c.ResponseError(c.T("account:Failed to set password, the user is either forbidden or deleted"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
isAdmin := c.IsAdmin()
|
isAdmin := c.IsAdmin()
|
||||||
if isAdmin {
|
if isAdmin {
|
||||||
if oldPassword != "" {
|
if oldPassword != "" {
|
||||||
|
Reference in New Issue
Block a user