From 6469f207f8b4d9b0def7e27288e73ad8323c62e4 Mon Sep 17 00:00:00 2001 From: mkrill <44435282+mkrill@users.noreply.github.com> Date: Thu, 5 Sep 2024 15:02:19 +0200 Subject: [PATCH] fix file session store creation, if directory exists (#433) --- framework/flamingo/sessions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/flamingo/sessions.go b/framework/flamingo/sessions.go index c9adb319..da5772b7 100644 --- a/framework/flamingo/sessions.go +++ b/framework/flamingo/sessions.go @@ -167,7 +167,7 @@ func (m *SessionModule) Configure(injector *dingo.Injector) { } case "file": err := os.Mkdir(m.fileName, os.ModePerm) - if err != nil { + if err != nil && !os.IsExist(err) { panic(fmt.Errorf("failed on creating directory %q for file session store: %w", m.fileName, err)) } sessionStore := sessions.NewFilesystemStore(m.fileName, []byte(m.secret))