From 8c93b3746b977e7441c2a3de661f35baa1186f86 Mon Sep 17 00:00:00 2001 From: Maximilian Date: Sun, 4 Dec 2022 19:06:51 -0600 Subject: [PATCH] Fix csrf token unexported error --- controllers/getController.go | 12 ++++++------ templates/pages/login.html | 2 +- templates/pages/register.html | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/controllers/getController.go b/controllers/getController.go index 6a80e15..4e3caef 100644 --- a/controllers/getController.go +++ b/controllers/getController.go @@ -27,17 +27,17 @@ func (getController *GetController) ShowHome(w http.ResponseWriter, _ *http.Requ func (getController *GetController) ShowRegister(w http.ResponseWriter, r *http.Request) { type dataStruct struct { - csrfToken string + CsrfToken string } // Create csrf token - csrfToken, err := security.GenerateCsrfToken(w, r) + CsrfToken, err := security.GenerateCsrfToken(w, r) if err != nil { return } data := dataStruct{ - csrfToken: csrfToken, + CsrfToken: CsrfToken, } templating.RenderTemplate(getController.App, w, "templates/pages/register.html", data) @@ -45,17 +45,17 @@ func (getController *GetController) ShowRegister(w http.ResponseWriter, r *http. func (getController *GetController) ShowLogin(w http.ResponseWriter, r *http.Request) { type dataStruct struct { - csrfToken string + CsrfToken string } // Create csrf token - csrfToken, err := security.GenerateCsrfToken(w, r) + CsrfToken, err := security.GenerateCsrfToken(w, r) if err != nil { return } data := dataStruct{ - csrfToken: csrfToken, + CsrfToken: CsrfToken, } templating.RenderTemplate(getController.App, w, "templates/pages/login.html", data) diff --git a/templates/pages/login.html b/templates/pages/login.html index 7281027..68514ca 100644 --- a/templates/pages/login.html +++ b/templates/pages/login.html @@ -2,7 +2,7 @@ {{ define "content" }}
- +


diff --git a/templates/pages/register.html b/templates/pages/register.html index fae5b2c..6bd6e51 100644 --- a/templates/pages/register.html +++ b/templates/pages/register.html @@ -2,7 +2,7 @@ {{ define "content" }} - +