feat: Implement basic (dummy) admin auth

This commit is contained in:
selfhoster selfhoster 2026-09-04 17:33:37 +02:00
commit 8c29f1d31f
13 changed files with 706 additions and 5 deletions

11
templates/base.html Normal file
View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>LLLDAP</title>
<link rel="stylesheet" href="/assets/css/main.css">
</head>
<body>
{% block main %}
{% endblock %}
</html>

11
templates/home.html Normal file
View file

@ -0,0 +1,11 @@
{% extends 'base.html' %}
{% block main %}
<main id="center">
<img src="/assets/img/logo.png" id="logo">
<p style="text-align: center;">You are logged in as {{ username }}</p>
<div id="login-line">
<a href="/logout" id="submit-login" value="Logout">Logout</a>
</div>
</main>
{% endblock %}

29
templates/login.html Normal file
View file

@ -0,0 +1,29 @@
{% extends 'base.html' %}
{% block main %}
<main id="center">
<img src="/assets/img/logo.png" id="logo">
{% if login_error == "InvalidCredentials" %}
<div class="banner is-error">
<p>Bad login/password</p>
</div>
{% elif login_error == "SessionInvalidated" %}
<div class="banner is-success">
<p>Logout successful</p>
</div>
{% endif %}
<form method="POST" action="/login">
<div id="login-line">
<img src="/assets/img/user.svg">
<input type="text" name="username" id="username" placeholder="Username">
</div>
<div id="login-line">
<img src="/assets/img/password.svg">
<input type="password" name="password" id="password" placeholder="Password">
</div>
<div id="login-line">
<input type="submit" id="submit-login" value="LOG IN">
</div>
</form>
</main>
{% endblock %}