Skip to content

Commit

Permalink
fix file session store creation, if directory exists (#433)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrill authored Sep 5, 2024
1 parent c4a1fe5 commit 6469f20
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion framework/flamingo/sessions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 6469f20

Please sign in to comment.