Fixed a bug where a user couldn't update its own password
the build failed
Details
the build failed
Details
This commit is contained in:
parent
aa5b510424
commit
63a74ee7ac
|
@ -30,9 +30,11 @@ func UserChangePassword(c echo.Context) error {
|
||||||
|
|
||||||
// Check if the user is admin or itself
|
// Check if the user is admin or itself
|
||||||
userJWTinfo, err := models.GetCurrentUser(c)
|
userJWTinfo, err := models.GetCurrentUser(c)
|
||||||
if !models.IsAdmin(c) || userJWTinfo.ID == userID {
|
if !models.IsAdmin(c) {
|
||||||
|
if userJWTinfo.ID != userID {
|
||||||
return echo.ErrUnauthorized
|
return echo.ErrUnauthorized
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Check for Request Content
|
// Check for Request Content
|
||||||
pwFromString := c.FormValue("password")
|
pwFromString := c.FormValue("password")
|
||||||
|
|
Loading…
Reference in New Issue