aboutsummaryrefslogtreecommitdiff
path: root/middleware/user.go
diff options
context:
space:
mode:
authorAlexander NeonXP Kiryukhin <i@neonxp.ru>2024-07-30 00:46:05 +0300
committerAlexander NeonXP Kiryukhin <i@neonxp.ru>2024-07-30 00:46:05 +0300
commit48a84eb03f6b17ee41d6f097c78d89488ba14e8c (patch)
tree5cef9486cf2bb07d828bfebe12e835e40f7f16f0 /middleware/user.go
parent96e2ce2e9d363a6296f9411ecb00168520258874 (diff)
Обновил сессии
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