Skip to content

Commit 8f5bc7d

Browse files
committed
typo: auth to admin
1 parent 7eb21f3 commit 8f5bc7d

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ file: golang-website-example.sql -> new database: golang-website-example
2424
#### Testing
2525
file: golang-website-example.sql -> new database: golang-website-example_test
2626

27-
## User Tables
27+
## Users Table
2828

2929
| Username | Password | is Admin |
3030
| --- | --- | --- |

controllers/user_controller.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,6 @@ func (controller *Controller) UpdateUserByPassword(c echo.Context) error {
506506
}
507507

508508
/*
509-
TODO:
510509
for example:
511510
username ockibagusp update by password 'ockibagusp': ok
512511
username ockibagusp update by password 'sugriwa': no
@@ -533,10 +532,7 @@ func (controller *Controller) UpdateUserByPassword(c echo.Context) error {
533532
}
534533

535534
if !middleware.CheckHashPassword(user.Password, _newPasswordForm.OldPassword) {
536-
log.Warnf(
537-
"for POST to update user by password without check hash password (%v): 403 Forbidden",
538-
middleware.CheckHashPassword(user.Password, _newPasswordForm.OldPassword),
539-
)
535+
log.Warn("for POST to update user by password without not check hash password: 403 Forbidden")
540536
middleware.SetFlashError(c, "check hash password is wrong!")
541537
log.Warn("END request method POST for update user by password: [-]failure")
542538
return c.Render(http.StatusForbidden, "user-view-password.html", echo.Map{

tests/user_controller_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,7 @@ func TestUpdateUserByPasswordUserController(t *testing.T) {
11681168
},
11691169
},
11701170
{
1171-
name: "users [auth] to POST update user by password it failure: id=1" +
1171+
name: "users [admin] to POST update user by password it failure: id=1" +
11721172
" POST passwords don't match",
11731173
expect: auth_admin,
11741174
method: POST,
@@ -1182,7 +1182,7 @@ func TestUpdateUserByPasswordUserController(t *testing.T) {
11821182
status: http.StatusForbidden,
11831183
},
11841184
{
1185-
name: "users [auth] to [sugriwa] POST update user by password it failure: id=2" +
1185+
name: "users [admin] to [sugriwa] POST update user by password it failure: id=2" +
11861186
" POST passwords don't match",
11871187
expect: auth_admin,
11881188
method: POST,
@@ -1196,7 +1196,7 @@ func TestUpdateUserByPasswordUserController(t *testing.T) {
11961196
status: http.StatusForbidden,
11971197
},
11981198
{
1199-
name: "users [auth] to POST update user by password it failure: id=-1",
1199+
name: "users [admin] to POST update user by password it failure: id=-1",
12001200
expect: auth_admin,
12011201
method: POST,
12021202
path: "-1",

0 commit comments

Comments
 (0)