Skip to content

Commit

Permalink
Merge pull request #389 from colin-axner/remove-unnecessary-var
Browse files Browse the repository at this point in the history
remove unnecessary var in account.go
  • Loading branch information
thebaer committed Nov 16, 2020
2 parents 3493921 + 75a79d4 commit d52e282
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions account.go
Expand Up @@ -151,8 +151,6 @@ func signupWithRegistration(app *App, signup userRegistration, w http.ResponseWr
}

// Handle empty optional params
// TODO: remove this var
createdWithPass := true
hashedPass, err := auth.HashPass([]byte(signup.Pass))
if err != nil {
return nil, impart.HTTPError{http.StatusInternalServerError, "Could not create password hash."}
Expand All @@ -162,7 +160,7 @@ func signupWithRegistration(app *App, signup userRegistration, w http.ResponseWr
u := &User{
Username: signup.Alias,
HashedPass: hashedPass,
HasPass: createdWithPass,
HasPass: true,
Email: prepareUserEmail(signup.Email, app.keys.EmailKey),
Created: time.Now().Truncate(time.Second).UTC(),
}
Expand All @@ -188,9 +186,6 @@ func signupWithRegistration(app *App, signup userRegistration, w http.ResponseWr
resUser := &AuthUser{
User: u,
}
if !createdWithPass {
resUser.Password = signup.Pass
}
title := signup.Alias
if signup.Normalize {
title = desiredUsername
Expand Down

0 comments on commit d52e282

Please sign in to comment.