From 5ae84c1995c664dba0ba81d8c2097b2402bdfa69 Mon Sep 17 00:00:00 2001 From: Maximilian Date: Wed, 15 Feb 2023 19:13:05 -0600 Subject: [PATCH] Remove unneeded comments --- security/csrf.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/security/csrf.go b/security/csrf.go index 91a0282..4395298 100644 --- a/security/csrf.go +++ b/security/csrf.go @@ -21,7 +21,6 @@ func GenerateCsrfToken(w http.ResponseWriter, _ *http.Request) (string, error) { str := hex.EncodeToString(buff) token := str[:64] - // Create session cookie, containing token cookie := &http.Cookie{ Name: "csrf_token", Value: token, @@ -38,7 +37,6 @@ func GenerateCsrfToken(w http.ResponseWriter, _ *http.Request) (string, error) { // VerifyCsrfToken verifies the csrf token func VerifyCsrfToken(r *http.Request) (bool, error) { - // Get csrf cookie cookie, err := r.Cookie("csrf_token") if err != nil { log.Println("Error getting csrf_token cookie") @@ -46,10 +44,8 @@ func VerifyCsrfToken(r *http.Request) (bool, error) { return false, err } - // Get csrf token from form token := r.FormValue("csrf_token") - // Compare csrf cookie and csrf token if cookie.Value == token { return true, nil }