From 3dde713b47082ded50b49e0f87d2a67aeb944b09 Mon Sep 17 00:00:00 2001 From: Sredny M Date: Wed, 29 Nov 2023 16:04:36 -0300 Subject: [PATCH] TT-6232 better session store handling (#350) * better session store handling * separate when SetupSessionStore is being called * separate when SetupSessionStore is being called --- main.go | 1 + tothic/tothic.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 0871c7eb..ad3c56e7 100644 --- a/main.go +++ b/main.go @@ -76,6 +76,7 @@ func init() { } tothic.TothErrorHandler = errors.HandleError + tothic.SetupSessionStore() } func main() { diff --git a/tothic/tothic.go b/tothic/tothic.go index 9ee03e2f..0c1475d6 100644 --- a/tothic/tothic.go +++ b/tothic/tothic.go @@ -48,7 +48,7 @@ func (p PathParam) MarshalBinary() ([]byte, error) { return json.Marshal(p) } -func init() { +func SetupSessionStore() { key := KeyFromEnv() Store = sessions.NewCookieStore([]byte(key)) }