Add login and auth

This commit is contained in:
MaxJa4
2024-01-16 22:15:26 +01:00
parent f92e22f142
commit 0fd45ea2bd
7 changed files with 206 additions and 46 deletions

View File

@@ -0,0 +1,3 @@
<div class="text-danger">
{{ .message }}
</div>

24
templates/login.html Normal file
View File

@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="de">
<head>
{{ template "header" . }}
</head>
<body data-bs-theme="dark" class="h-auto">
<div class="container-fluid bg-dark mt-5 p-4 rounded-3 text-light text-center" style="max-width: 500px;">
<h3>Login</h3>
<hr>
<form hx-post="/login" hx-target="#login-result">
<div class="form-floating mb-3">
<input class="form-control form-control-lg" type="text" id="username" name="username" placeholder="Username" required>
<label for="username">Username</label>
</div>
<div class="form-floating">
<input class="form-control form-control-lg" type="password" id="password" name="password" placeholder="Passwort" required>
<label for="password">Passwort</label>
</div>
<button class="btn btn-lg btn-primary mt-3" type="submit">Anmelden</button>
</form>
<div id="login-result" class="mt-4 fs-4"></div>
</div>
</body>
</html>