Ersetzt die handgestrickte bcrypt+Session-Auth durch fastapi-users (CookieTransport+JWTStrategy statt Starlette-Session, custom psycopg3-async-Adapter statt SQLAlchemy). Bestehende bcrypt-Hashes bleiben gültig und werden beim nächsten Login automatisch auf Argon2 angehoben (pwdlib-Default-PasswordHelper). ist_admin wird zu is_superuser, damit fastapi-users' eingebaute Semantik direkt nutzbar ist - require_admin/get_current_user bleiben als Wrapper unter gleichem Namen, alle Router-Dateien bis auf geraete.py (dict- zu attribut-Zugriff auf user.organization_id) unverändert. Lokal end-to-end gegen eine Wegwerf-Postgres-Instanz (podman) verifiziert: Migration, Bestandskonto-Login mit altem Passwort samt Argon2-Upgrade, Admin-Kontoanlage über beide Aufrufstellen (create_user.py und admin_kunden.py), 403 für Nicht-Admins, Logout. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
33 lines
1.1 KiB
HTML
33 lines
1.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="de">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>{% block title %}Tuxflotte{% endblock %}</title>
|
|
<link rel="stylesheet" href="/static/pico.min.css">
|
|
<style>
|
|
.state-present { color: var(--pico-ins-color); font-weight: 600; }
|
|
.state-absent { color: var(--pico-muted-color); }
|
|
.optionen label { font-weight: normal; }
|
|
td form { margin-bottom: 0; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<header class="container">
|
|
<nav>
|
|
<ul><li><strong><a href="/geraete">Tuxflotte Kundenplattform</a></strong></li></ul>
|
|
{% if user %}
|
|
<ul>
|
|
{% if user.is_superuser %}<li><a href="/admin/technik">Admin</a></li>{% endif %}
|
|
<li>{{ user.email }}</li>
|
|
<li><a href="/logout" role="button" class="secondary outline">Abmelden</a></li>
|
|
</ul>
|
|
{% endif %}
|
|
</nav>
|
|
</header>
|
|
<main class="container">
|
|
{% block content %}{% endblock %}
|
|
</main>
|
|
</body>
|
|
</html>
|