File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -532,11 +532,9 @@ func (controller *Controller) UpdateUserByPassword(c echo.Context) error {
532532 ConfirmNewPassword : c .FormValue ("confirm_new_password" ),
533533 }
534534
535- // TODO: middleware.CheckHashPassword?
536- if (middleware .IsAdmin (is_auth_type ) && middleware .IsUser (is_auth_type )) && middleware .CheckHashPassword (user .Password , _newPasswordForm .OldPassword ) {
535+ if ! middleware .CheckHashPassword (user .Password , _newPasswordForm .OldPassword ) {
537536 log .Warnf (
538- "for POST to update user by password without IsAdmin and IsUser (%v) and check hash password (%v): 403 Forbidden" ,
539- middleware .IsAdmin (is_auth_type ) && middleware .IsUser (is_auth_type ),
537+ "for POST to update user by password without check hash password (%v): 403 Forbidden" ,
540538 middleware .CheckHashPassword (user .Password , _newPasswordForm .OldPassword ),
541539 )
542540 middleware .SetFlashError (c , "check hash password is wrong!" )
You can’t perform that action at this time.
0 commit comments