From 3f4d18516617756169d8e115f310e08f6d0b2eab Mon Sep 17 00:00:00 2001 From: ptrcnull Date: Thu, 7 Oct 2021 17:05:45 +0200 Subject: [PATCH] fix: Move SetSessionConfig to App --- app.go | 4 ++++ manager.go | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app.go b/app.go index fb94605..631c89e 100644 --- a/app.go +++ b/app.go @@ -91,3 +91,7 @@ func (app *App) Run(addr string) error { func (app *App) AuthSupported() bool { return len(app.authHandlers) > 0 } + +func (app *App) SetSessionConfig(config session.Config) { + app.sessions = session.New(config) +} diff --git a/manager.go b/manager.go index 7bf6798..2d4332b 100644 --- a/manager.go +++ b/manager.go @@ -57,6 +57,7 @@ func (mm *ModuleManager) SetHomepage(template string, handlers ...func(map[strin mm.app.homepageHandlers = handlers } +// Deprecated: SetSessionConfig is deprecated, use app.SetSessionConfig func (mm *ModuleManager) SetSessionConfig(config session.Config) { - mm.app.sessions = session.New(config) + mm.app.SetSessionConfig(config) }