mirror of
https://github.com/HChaZZY/alist.git
synced 2025-12-06 11:03:49 +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
|
return
|
||||||
}
|
}
|
||||||
user := c.MustGet("user").(*model.User)
|
user := c.MustGet("user").(*model.User)
|
||||||
|
if user.IsGuest() {
|
||||||
|
common.ErrorStrResp(c, "Guest user can not update profile", 403)
|
||||||
|
return
|
||||||
|
}
|
||||||
user.Username = req.Username
|
user.Username = req.Username
|
||||||
if req.Password != "" {
|
if req.Password != "" {
|
||||||
user.SetPassword(req.Password)
|
user.SetPassword(req.Password)
|
||||||
|
|||||||
Reference in New Issue
Block a user