mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-02 11:20:18 +08:00
feat: add forbidden check in SetPassword()
This commit is contained in:
@ -473,6 +473,11 @@ func (c *ApiController) SetPassword() {
|
||||
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()
|
||||
if isAdmin {
|
||||
if oldPassword != "" {
|
||||
|
Reference in New Issue
Block a user