aboutsummaryrefslogtreecommitdiff
path: root/middleware/user.go
diff options
context:
space:
mode:
Diffstat (limited to 'middleware/user.go')
-rw-r--r--middleware/user.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/middleware/user.go b/middleware/user.go
index f4eb12a..419061f 100644
--- a/middleware/user.go
+++ b/middleware/user.go
@@ -13,7 +13,8 @@ func UserMiddleware() mux.Middleware {
return func(h http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
session := session.FromRequest(r)
- user := (*session)["user"]
+ values := session.Values(r.Context())
+ user := values["user"]
if user == nil {
h.ServeHTTP(w, r)
return