feat: Working login form with htmx.
This commit is contained in:
@@ -9,10 +9,10 @@
|
||||
|
||||
<body>
|
||||
<h1>#(title)</h1>
|
||||
<div id="body"
|
||||
hx-get="/body"
|
||||
<div id="content"
|
||||
hx-get="/home"
|
||||
hx-trigger="load"
|
||||
hx-swap="outerHTML">
|
||||
>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
<div id="body">
|
||||
<p>We're in!</p>
|
||||
</div>
|
||||
<p>We're in!</p>
|
||||
<button hx-post="/logout"
|
||||
hx-target="#content"
|
||||
hx-trigger="click"
|
||||
>
|
||||
Log Out.
|
||||
</button>
|
||||
|
||||
@@ -1,15 +1,9 @@
|
||||
<div id="body" class="container">
|
||||
<form class="login-form">
|
||||
<label for="email">Email</label>
|
||||
<input type="text" id="email" placeholder="Email" name="email" autocomplete="email" required autofocus>
|
||||
<br>
|
||||
<label for="password">Password</label>
|
||||
<input type="password" id="password" placeholder="Password" name="password" autocomplete="current-password" required>
|
||||
<br>
|
||||
<button hx-post="/login"
|
||||
hx-target="#body"
|
||||
hx-trigger="click">
|
||||
Sign In
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<form class="login-form" hx-post="/login" hx-target="#content">
|
||||
<label for="username">Username</label>
|
||||
<input type="text" id="username" placeholder="Username" name="username" autocomplete="username" required autofocus>
|
||||
<br>
|
||||
<label for="password">Password</label>
|
||||
<input type="password" id="password" placeholder="Password" name="password" autocomplete="current-password" required>
|
||||
<br>
|
||||
<input type="submit" value="Sign In">
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user