Fixed a bug where a user couldn't update its own password
the build failed Details

This commit is contained in:
konrad 2018-01-26 15:09:33 +01:00 committed by kolaente
parent aa5b510424
commit 63a74ee7ac
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 4 additions and 2 deletions

View File

@ -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