Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
John-Lin committed Sep 20, 2018
1 parent 3a18f78 commit 30d4ce7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/server/handler_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ func patchPasswordHandler(ctx *web.Context) {
response.BadRequest(req.Request, resp.ResponseWriter, err)
return
}
newCred.Username = user.LoginCredential.Username

if err := sp.Validator.Struct(newCred); err != nil {
response.BadRequest(req.Request, resp.ResponseWriter, err)
Expand All @@ -111,7 +112,6 @@ func patchPasswordHandler(ctx *web.Context) {
response.BadRequest(req.Request, resp.ResponseWriter, err)
return
}
newCred.Username = user.LoginCredential.Username
newCred.Password = hashedPassword

user.LoginCredential = newCred
Expand Down
1 change: 1 addition & 0 deletions src/server/handler_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ func (suite *UserTestSuite) TestPatchPassword() {

// start to change the password
newCred := entity.LoginCredential{
Username: testUsername,
Password: "p@ssw0rd",
}

Expand Down

0 comments on commit 30d4ce7

Please sign in to comment.