+Datenexport

This commit is contained in:
Simon Martens
2026-01-28 17:26:04 +01:00
parent de37145471
commit b0a57884bf
19 changed files with 3729 additions and 1931 deletions

View File

@@ -2,6 +2,7 @@ package templating
import (
"fmt"
"strings"
"github.com/Theodor-Springmann-Stiftung/musenalm/dbmodels"
"github.com/pocketbase/pocketbase/core"
@@ -87,7 +88,11 @@ func (r *Request) IsEditor() bool {
}
func (r *Request) CheckCSRF(target string) error {
if r.Session() == nil || target == "" || r.Session().Token != target {
target = strings.TrimSpace(target)
if r.Session() == nil || target == "" {
return fmt.Errorf("CSRF-Token nicht vorhanden oder ungültig")
}
if r.Session().Token != target && r.Session().CSRF != target {
return fmt.Errorf("CSRF-Token nicht vorhanden oder ungültig")
}
return nil