mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2025-07-19 01:48:42 +08:00
fix: prevent guest user from updating profile (#8447)
This commit is contained in:
@ -113,6 +113,10 @@ func UpdateCurrent(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
user := c.MustGet("user").(*model.User)
|
||||
if user.IsGuest() {
|
||||
common.ErrorStrResp(c, "Guest user can not update profile", 403)
|
||||
return
|
||||
}
|
||||
user.Username = req.Username
|
||||
if req.Password != "" {
|
||||
user.SetPassword(req.Password)
|
||||
|
Reference in New Issue
Block a user