rename GetUserFromName -> GetUserByName

This commit is contained in:
sentriz
2020-07-16 22:59:55 +01:00
parent 19e4958f2f
commit f34a0b48f9
5 changed files with 22 additions and 10 deletions

View File

@@ -16,7 +16,7 @@ func (c *Controller) ServeLoginDo(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, r.Referer(), http.StatusSeeOther)
return
}
user := c.DB.GetUserFromName(username)
user := c.DB.GetUserByName(username)
if user == nil || password != user.Password {
sessAddFlashW(session, []string{"invalid username / password"})
sessLogSave(session, w, r)
@@ -26,7 +26,7 @@ func (c *Controller) ServeLoginDo(w http.ResponseWriter, r *http.Request) {
// put the user name into the session. future endpoints after this one
// are wrapped with WithUserSession() which will get the name from the
// session and put the row into the request context
session.Values["user"] = user.Name
session.Values["user"] = user.ID
sessLogSave(session, w, r)
http.Redirect(w, r, c.Path("/admin/home"), http.StatusSeeOther)
}