Added CSRF & YouTube and dark mode
This commit is contained in:
19
backend/api/get_csrf.go
Normal file
19
backend/api/get_csrf.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user