check errors returned by sessionstoreE

This commit is contained in:
Danny van Kooten 2018-05-10 22:21:44 +02:00
parent 54edd87d00
commit e2d45dbc40
1 changed files with 5 additions and 1 deletions

View File

@ -70,7 +70,11 @@ var LogoutHandler = HandlerFunc(func(w http.ResponseWriter, r *http.Request) err
/* middleware */
func Authorize(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
session, _ := store.Get(r, "auth")
session, err := store.Get(r, "auth")
if err != nil {
return
}
userID, ok := session.Values["user_id"]
if session.IsNew || !ok {