Added CSRF & YouTube and dark mode

This commit is contained in:
cdricms
2025-01-22 17:39:03 +01:00
parent 48e761667f
commit 5a5846d853
29 changed files with 1186 additions and 280 deletions

19
backend/api/get_csrf.go Normal file
View File

@@ -0,0 +1,19 @@
package api
import (
"fmt"
"net/http"
"fr.latosa-escrima/api/core"
"github.com/gorilla/csrf"
)
func HandleCSRF(w http.ResponseWriter, r *http.Request) {
token := csrf.Token(r)
fmt.Println(token)
core.JSONSuccess{
Status: core.Success,
Message: "CSRF generated.",
Data: map[string]string{"csrf": token},
}.Respond(w, http.StatusOK)
}