use default null instead of pointer to primary key

This commit is contained in:
sentriz
2019-05-27 11:22:01 +01:00
parent 4b66a84985
commit 601cf560d0
9 changed files with 58 additions and 56 deletions

View File

@@ -26,7 +26,7 @@ func (c *Controller) ServeLoginDo(w http.ResponseWriter, r *http.Request) {
return
}
user := c.GetUserFromName(username)
if !(username == user.Name && password == user.Password) {
if user == nil || password != user.Password {
session.AddFlash("invalid username / password")
session.Save(r, w)
http.Redirect(w, r, r.Header.Get("Referer"), http.StatusSeeOther)