summaryrefslogtreecommitdiff
path: root/internal/handlers/auth.go
diff options
context:
space:
mode:
authorGrailFinder <wohilas@gmail.com>2024-06-02 15:00:41 +0300
committerGrailFinder <wohilas@gmail.com>2024-06-02 15:00:41 +0300
commit60fc1773241195f4988ed8066e019bbc42267085 (patch)
tree91dec5a4e298a8b3eb0870649ed8d5031a685001 /internal/handlers/auth.go
parentd0ec9f38b17dadf4c244904e28e064d6ad7c5674 (diff)
Enha: add db method to list recs
Diffstat (limited to 'internal/handlers/auth.go')
-rw-r--r--internal/handlers/auth.go9
1 files changed, 1 insertions, 8 deletions
diff --git a/internal/handlers/auth.go b/internal/handlers/auth.go
index e147efc..b470c57 100644
--- a/internal/handlers/auth.go
+++ b/internal/handlers/auth.go
@@ -49,7 +49,7 @@ func (h *Handlers) HandleSignup(w http.ResponseWriter, r *http.Request) {
}
if err := h.repo.DBUserScoreCreate(newUser); err != nil {
msg := "failed to create user"
- h.log.Error(msg, "user", newUser)
+ h.log.Error(msg, "user", newUser, "error", err)
abortWithError(w, msg)
return
}
@@ -98,13 +98,6 @@ func (h *Handlers) HandleLogin(w http.ResponseWriter, r *http.Request) {
abortWithError(w, err.Error())
return
}
- // check password
- // hashedPassword, err := bcrypt.GenerateFromPassword([]byte(password), 8)
- // if err != nil {
- // h.log.Warn("failed to gen pass hash", "err", err)
- // abortWithError(w, err.Error())
- // return
- // }
if err := bcrypt.CompareHashAndPassword(
[]byte(userScore.Password), []byte(password),
); err != nil {