fix shadowing issue in login
This commit is contained in:
parent
a47a0318a7
commit
e68392387a
|
@ -41,9 +41,9 @@ func AccountLoginSubmit(w http.ResponseWriter, r *http.Request, user *c.User) c.
|
||||||
if err != nil {
|
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?
|
// 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()}
|
logItem := &c.LoginLogItem{UID: uid, Success: false, IP: user.GetIP()}
|
||||||
_, err := logItem.Create()
|
_, ierr := logItem.Create()
|
||||||
if err != nil {
|
if ierr != nil {
|
||||||
return c.InternalError(err, w, r)
|
return c.InternalError(ierr, w, r)
|
||||||
}
|
}
|
||||||
return c.LocalError(err.Error(), w, r, user)
|
return c.LocalError(err.Error(), w, r, user)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue