File tree Expand file tree Collapse file tree 2 files changed +2
-5
lines changed
Expand file tree Collapse file tree 2 files changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -107,7 +107,6 @@ $ go test github.com/ockibagusp/golang-website-example/tests -v
107107
108108
109109## TODO List
110- - Table database Users to testing: admin, user and no-auth
111110- Admin Users: delete table User `deleted_at` @route: /users/admin/delete
112111
113112 button:
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