Update frame work and workspace codebase

This commit is contained in:
2025-12-13 17:44:42 +00:00
parent 8100f87686
commit 72b5c18f29
16 changed files with 1499 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
package http
import (
"net/http"
)
// templateData adds CSRF token and other common data to template context
func templateData(r *http.Request, data map[string]interface{}) map[string]interface{} {
if data == nil {
data = make(map[string]interface{})
}
// Get CSRF token from cookie
if cookie, err := r.Cookie("csrf_token"); err == nil {
data["CSRFToken"] = cookie.Value
}
return data
}