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

@@ -30,7 +30,7 @@ func (c *Controller) WithUserSession(next http.HandlerFunc) http.HandlerFunc {
}
// take username from sesion and add the user row to the context
user := c.GetUserFromName(username)
if *user.ID == 0 {
if user == nil {
// the username in the client's session no longer relates to a
// user in the database (maybe the user was deleted)
session.Options.MaxAge = -1