From 48a84eb03f6b17ee41d6f097c78d89488ba14e8c Mon Sep 17 00:00:00 2001 From: Alexander NeonXP Kiryukhin Date: Tue, 30 Jul 2024 00:46:05 +0300 Subject: Обновил сессии MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- middleware/user.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'middleware/user.go') 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 -- cgit v1.2.3