diff --git a/routes/api/v1/user_update_password.go b/routes/api/v1/user_update_password.go index 685b58e..0c2e554 100644 --- a/routes/api/v1/user_update_password.go +++ b/routes/api/v1/user_update_password.go @@ -30,8 +30,10 @@ func UserChangePassword(c echo.Context) error { // Check if the user is admin or itself userJWTinfo, err := models.GetCurrentUser(c) - if !models.IsAdmin(c) || userJWTinfo.ID == userID { - return echo.ErrUnauthorized + if !models.IsAdmin(c) { + if userJWTinfo.ID != userID { + return echo.ErrUnauthorized + } } // Check for Request Content