From 75a79d49bdcfd866e8c1942551f1a03f2831ce8f Mon Sep 17 00:00:00 2001 From: Colin Axner Date: Fri, 25 Sep 2020 16:07:30 +0200 Subject: [PATCH] remove unnecessary var Remove createdWithPass var in account.go along with impossible if statement --- account.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/account.go b/account.go index ba013c2..b7343df 100644 --- a/account.go +++ b/account.go @@ -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."} @@ -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(), } @@ -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