added setting of csrf

This commit is contained in:
2026-02-18 10:16:56 +08:00
parent b2b7cacaa6
commit 7020e16a97
2 changed files with 16 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
package handlers
import (
"authentication/helper"
"net/http"
)
// CSRFToken issues a CSRF token by relying on the CSRFMiddleware
// to set the token in the response header and cookie on GET requests.
func CSRFToken(w http.ResponseWriter, r *http.Request) {
helper.RespondWithJSON(w, http.StatusOK, map[string]string{
"message": "CSRF token set",
})
}