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,8 +30,10 @@ 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) {
|
||||||
return echo.ErrUnauthorized
|
if userJWTinfo.ID != userID {
|
||||||
|
return echo.ErrUnauthorized
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for Request Content
|
// Check for Request Content
|
||||||
|
|
Loading…
Reference in New Issue