Bootstrapped the creation and loading of session keys to lighten main.

This commit is contained in:
2025-04-16 08:21:02 +01:00
parent 0a21973237
commit 4bb3b58ddb
8 changed files with 95 additions and 13 deletions

View File

@@ -27,6 +27,11 @@ func main() {
db := storage.InitDB("synlotto.db")
models.SetDB(db) // Should be in storage not models.
err = bootstrap.InitSession(appState.Config)
if err != nil {
logging.Error("❌ Failed to init session: %v", err)
}
err = securityhandlers.InitCSRFProtection([]byte(appState.Config.CSRF.CSRFKey), appState.Config.HttpServer.ProductionMode)
if err != nil {
logging.Error("Failed to init CSRF: %v", err)