Skip to content

Commit

Permalink
wait for server startup
Browse files Browse the repository at this point in the history
  • Loading branch information
John-Lin committed Sep 1, 2018
1 parent 4f3480c commit b952417
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ src.test-coverage-vagrant:
src.test-bats:
sed -i.bak "s/localhost:9090/$$(minikube ip):30003/g; s/localhost:27017/$$(minikube ip):31717/g" config/testing.json
./build/src/cmd/vortex/vortex -config config/testing.json -port 7890 &
@echo "Waiting for server startup"
sleep 1
@cd tests;\
./test.sh

Expand Down
8 changes: 4 additions & 4 deletions src/server/handler_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ func signUpUserHandler(ctx *web.Context) {
return
}

encryptedPassword, err := utils.HashPassword(user.LoginCredential.Password)
hashedPassword, err := utils.HashPassword(user.LoginCredential.Password)
if err != nil {
response.BadRequest(req.Request, resp.ResponseWriter, err)
return
}
user.LoginCredential.Password = encryptedPassword
user.LoginCredential.Password = hashedPassword

user.LoginCredential.Username = strings.ToLower(user.LoginCredential.Username)

Expand Down Expand Up @@ -134,12 +134,12 @@ func createUserHandler(ctx *web.Context) {
return
}

encryptedPassword, err := utils.HashPassword(user.LoginCredential.Password)
hashedPassword, err := utils.HashPassword(user.LoginCredential.Password)
if err != nil {
response.BadRequest(req.Request, resp.ResponseWriter, err)
return
}
user.LoginCredential.Password = encryptedPassword
user.LoginCredential.Password = hashedPassword

user.LoginCredential.Username = strings.ToLower(user.LoginCredential.Username)

Expand Down

0 comments on commit b952417

Please sign in to comment.