Login redirect only on success and new auth success message

This commit is contained in:
2025-12-15 15:29:16 +01:00
parent 36dbc849ca
commit fef5119a03
3 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -127,7 +127,7 @@ def login():
(uidquery, int(time.time()), timeout, "", session)
)
response = redirect("/")
response = make_response("<script>location.href = '/';</script>")
response.set_cookie('session', value=session, expires=timeout)
return response
+1 -1
View File
@@ -1,5 +1,5 @@
<h2>Einloggen</h2>
<form action="/auth/login" method="post" >
<form hx-post="/auth/login" hx-target="#main-frame" >
<input type="text" name="user" placeholder="Nutzername" value="{{ username }}"><br>
<input type="password" name="pass" placeholder="Passphrase"><br>
<label>Automatisch abmelden in:</label>
+3
View File
@@ -1 +1,4 @@
<h2>Willkommen im Kontrollverlust!</h2>
<p>Du kannst dich nun als {{username}} <button hx-get="/auth/login" hx-target="#main-frame">Anmelden</button>
!</p>