feat: complete go rewrite

This commit is contained in:
Blake Ridgway
2025-11-12 19:18:29 -06:00
parent 9d78f1fdb4
commit cb3293c7b0
26 changed files with 1286 additions and 531 deletions

24
sessions.go Normal file
View File

@@ -0,0 +1,24 @@
package main
import (
"log"
"github.com/gorilla/sessions"
)
var store *sessions.CookieStore
func initSessions() {
if config.SecretKey == "" {
log.Fatal("SECRET_KEY not set in configuration")
}
store = sessions.NewCookieStore([]byte(config.SecretKey))
store.Options = &sessions.Options{
Path: "/",
MaxAge: 86400 * 7, // 7 days
HttpOnly: true,
Secure: false, // Set to true in production with HTTPS
SameSite: 0,
}
log.Println("Sessions initialized")
}