From e68392387a20029a09c7ff62ffc430ddbe5b164c Mon Sep 17 00:00:00 2001 From: Azareal Date: Fri, 27 Mar 2020 09:30:59 +1000 Subject: [PATCH] fix shadowing issue in login --- routes/account.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/routes/account.go b/routes/account.go index 4f3e97d9..61e64052 100644 --- a/routes/account.go +++ b/routes/account.go @@ -41,9 +41,9 @@ func AccountLoginSubmit(w http.ResponseWriter, r *http.Request, user *c.User) c. if err != nil { // TODO: uid is currently set to 0 as authenticate fetches the user by username and password. Get the actual uid, so we can alert the user of attempted logins? What if someone takes advantage of the response times to deduce if an account exists? logItem := &c.LoginLogItem{UID: uid, Success: false, IP: user.GetIP()} - _, err := logItem.Create() - if err != nil { - return c.InternalError(err, w, r) + _, ierr := logItem.Create() + if ierr != nil { + return c.InternalError(ierr, w, r) } return c.LocalError(err.Error(), w, r, user) }