mirror of
https://github.com/Theodor-Springmann-Stiftung/musenalm.git
synced 2025-10-29 09:15:33 +00:00
User edit -> Alpine Ajax
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package templating
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/Theodor-Springmann-Stiftung/musenalm/dbmodels"
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
)
|
||||
@@ -83,3 +85,10 @@ func (r *Request) IsEditor() bool {
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (r *Request) CheckCSRF(target string) error {
|
||||
if r.Session() == nil || target == "" || r.Session().Token != target {
|
||||
return fmt.Errorf("CSRF-Token nicht vorhanden oder ungültig")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user