From cf9ff61df1214843f72855e64409717335c23d31 Mon Sep 17 00:00:00 2001 From: Adam Jimerson Date: Tue, 20 Oct 2026 11:34:08 -0400 Subject: [PATCH] Update the example site showing the usage of .csrf_field Update the example site showing the usage fo the newly added .csrf_field template function. Signed-off-by: Adam Jimerson --- resources/views/admin/index.tmpl | 1 + tests/feature/http_test.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/views/admin/index.tmpl b/resources/views/admin/index.tmpl index 009caa5..5046cfe 100644 --- a/resources/views/admin/index.tmpl +++ b/resources/views/admin/index.tmpl @@ -2,5 +2,6 @@ {{ template "admin/header.tmpl" . }}

Hello, {{ .name }}

CSRF Token: {{ .csrf_token }}

+

CSRF Field: {{ .csrf_field }}

{{ template "admin/footer.tmpl" . }} {{ end }} \ No newline at end of file diff --git a/tests/feature/http_test.go b/tests/feature/http_test.go index 61ce095..9acd215 100644 --- a/tests/feature/http_test.go +++ b/tests/feature/http_test.go @@ -377,7 +377,7 @@ func (s *HttpTestSuite) TestView() { csrfToken := resp.Headers().Get("X-CSRF-TOKEN") s.NotEmpty(csrfToken) - s.Equal(context, fmt.Sprintf("\n \n\n \n

I'm the header

\n\n

Hello, Goravel

\n

CSRF Token: %s

\n \n

I'm the footer

\n \n\n\n", csrfToken)) + s.Equal(context, fmt.Sprintf("\n \n\n \n

I'm the header

\n\n

Hello, Goravel

\n

CSRF Token: %s

\n

CSRF Field:

\n \n

I'm the footer

\n \n\n\n", csrfToken, csrfToken)) } func (s *HttpTestSuite) TestProviderRoute() {