diff options
author | René 'Necoro' Neumann <necoro@necoro.eu> | 2024-10-17 21:58:48 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.eu> | 2024-10-17 21:58:48 +0200 |
commit | ae6e2c5070569eaf2d420e0c3e01c9ea1377b8eb (patch) | |
tree | 2704d5aeab636e845a820c5fe557001e668981c4 /pages | |
parent | 6f0639fdff8968214107061b71783ba4f264b8ca (diff) | |
download | gosten-ae6e2c5070569eaf2d420e0c3e01c9ea1377b8eb.tar.gz gosten-ae6e2c5070569eaf2d420e0c3e01c9ea1377b8eb.tar.bz2 gosten-ae6e2c5070569eaf2d420e0c3e01c9ea1377b8eb.zip |
Don't use hardcoded url
Diffstat (limited to 'pages')
-rw-r--r-- | pages/login.templ | 2 | ||||
-rw-r--r-- | pages/login_templ.go | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/pages/login.templ b/pages/login.templ index fed611e..a97d979 100644 --- a/pages/login.templ +++ b/pages/login.templ @@ -7,7 +7,7 @@ import ( templ login(u user) { @base() { <main class="d-flex align-items-center min-vh-100"> - <form action="/login" method="post" class="container mx-auto" style="max-width: 440px;"> + <form action={templ.SafeURL(getCurrPath(ctx))} method="post" class="container mx-auto" style="max-width: 440px;"> <img src="/static/euro-money.svg" width="96" height="96" class="mb-4"/> @form.Form(u, u.Errors) @u.Csrf() diff --git a/pages/login_templ.go b/pages/login_templ.go index 617e3b5..f04b654 100644 --- a/pages/login_templ.go +++ b/pages/login_templ.go @@ -45,7 +45,16 @@ func login(u user) templ.Component { }() } ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<main class=\"d-flex align-items-center min-vh-100\"><form action=\"/login\" method=\"post\" class=\"container mx-auto\" style=\"max-width: 440px;\"><img src=\"/static/euro-money.svg\" width=\"96\" height=\"96\" class=\"mb-4\">") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<main class=\"d-flex align-items-center min-vh-100\"><form action=\"") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var3 templ.SafeURL = templ.SafeURL(getCurrPath(ctx)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var3))) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" method=\"post\" class=\"container mx-auto\" style=\"max-width: 440px;\"><img src=\"/static/euro-money.svg\" width=\"96\" height=\"96\" class=\"mb-4\">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } |