Skip to content

Commit 1d90844

Browse files
fix: redirect instead of location HTMX
1 parent 5b58c82 commit 1d90844

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

web/helpers/http.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func IsHTMXRequest(c *fiber.Ctx) bool {
1414

1515
func Redirect(c *fiber.Ctx, path string) error {
1616
if IsHTMXRequest(c) {
17-
c.Set("HX-Location", path)
17+
c.Set("HX-Redirect", path)
1818
return nil
1919
} else {
2020
return c.Redirect(path)

web/views/login.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ <h1>SMTPBridge</h1>
88
<article class="max-w-md mx-auto">
99
<h2>Login</h2>
1010
{{block "form" .}}
11-
<form method="post" action="/login" hx-post="/login" hx-swap="outerHTML">
11+
<form method="post" action="/login" hx-post="/login" hx-swap="outerHTML" hx-boost="false">
1212
{{csrf $}}
1313
<label for="username">
1414
Username

web/views/partials/header.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</a>
99
</li>
1010
</ul>
11-
<ul class=" block lg:hidden">
11+
<ul class="block lg:hidden">
1212
<li class="p-0 flex flex-items-center h-full">
1313
<details role="list" dir="rtl">
1414
<summary aria-haspopup="listbox" class="block pico-no-chevron">

0 commit comments

Comments
 (0)