Skip to content

Commit

Permalink
feat: user demo not allowed change password
Browse files Browse the repository at this point in the history
Signed-off-by: saltbo <saltbo@foxmail.com>
  • Loading branch information
saltbo committed Jul 30, 2023
1 parent 4e67770 commit 98357f0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/app/service/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ func (u *User) PasswordUpdate(uid int64, oldPwd, newPwd string) error {
return err
} else if user.Password != strutil.Md5Hex(oldPwd) {
return fmt.Errorf("error password")
} else if user.Username == "demo" {
return fmt.Errorf("user demo not allowed change password")
}

user.Password = strutil.Md5Hex(newPwd)
Expand Down

0 comments on commit 98357f0

Please sign in to comment.