diff options
author | Alexander NeonXP Kiryukhin <i@neonxp.ru> | 2024-07-30 00:46:05 +0300 |
---|---|---|
committer | Alexander NeonXP Kiryukhin <i@neonxp.ru> | 2024-07-30 00:46:05 +0300 |
commit | 48a84eb03f6b17ee41d6f097c78d89488ba14e8c (patch) | |
tree | 5cef9486cf2bb07d828bfebe12e835e40f7f16f0 /app | |
parent | 96e2ce2e9d363a6296f9411ecb00168520258874 (diff) |
Обновил сессии
Diffstat (limited to 'app')
-rw-r--r-- | app/cmd/serve.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/cmd/serve.go b/app/cmd/serve.go index 578de1e..4222580 100644 --- a/app/cmd/serve.go +++ b/app/cmd/serve.go @@ -95,12 +95,14 @@ func serve(ctx context.Context) error { e.Handle("/assets/", http.StripPrefix("/assets", http.FileServerFS(assets.FS))) + sessionManager := session.New(session.NewBoltStore(orm, []byte("sessions"))) + mh := mux.Use(e, middleware.Logger(slog.Default()), - middleware.Recover(slog.Default()), + // middleware.Recover(slog.Default()), middleware.RequestID, appmiddleware.UserMiddleware(), - session.Middleware(session.DefaultConfig, session.NewBoltStore(orm, []byte("sessions"))), + sessionManager.Middleware(), ) slog.InfoContext(ctx, "started gorum", slog.String("bind", listen)) |