Owner accounts: auth, password reset, CRM dashboard visibility (#19)

Flask-session login scoped to one client_id (never a request param),
self-service + operator-triggered password reset via single-use tokens,
and an Owner accounts tab on the CRM dashboard.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-03 17:00:37 +02:00
parent 644c99ee30
commit 59c35ce39f
14 changed files with 635 additions and 0 deletions
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8" />
<title>Passwort zurücksetzen</title>
</head>
<body style="margin:0; padding:20px; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; color:#16302f;">
<h1 style="font-size:1.2rem; margin:0 0 14px;">{{ business_name }}</h1>
<p>Sie haben ein neues Passwort für Ihr Konto angefordert (oder es wurde für Sie angefordert).</p>
<p>Über den folgenden Link können Sie ein neues Passwort vergeben:</p>
<p><a href="{{ reset_url }}">{{ reset_url }}</a></p>
<p>Falls Sie dies nicht angefordert haben, können Sie diese E-Mail ignorieren.</p>
</body>
</html>
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="robots" content="noindex" />
<title>Mein Konto — {{ client.business_name if client else '' }}</title>
<style>
:root {
--brand: #0f8a7e;
--bg: #fff; --ink: #16302f; --muted: #5d716f; --line: #e3eae9;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
background: var(--bg); color: var(--ink); padding: 20px; max-width: 480px; }
h1 { font-size: 1.2rem; margin: 0 0 18px; }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 20px; background: #f6faf9; }
.muted { color: var(--muted); font-size: .85rem; }
a { color: var(--brand); }
</style>
</head>
<body>
<h1>{{ client.business_name if client else 'Mein Konto' }}</h1>
<div class="card">
<p>Sie sind angemeldet.</p>
<p class="muted">Kalender, Buchungen und Einstellungen folgen hier.</p>
</div>
<p class="muted"><a href="{{ url_for('owner_auth.logout') }}">Abmelden</a></p>
</body>
</html>
@@ -0,0 +1,46 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="robots" content="noindex" />
<title>Passwort vergessen</title>
<style>
:root {
--brand: #0f8a7e;
--bg: #fff; --ink: #16302f; --muted: #5d716f; --line: #e3eae9;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
background: var(--bg); color: var(--ink); padding: 20px; max-width: 380px; }
h1 { font-size: 1.2rem; margin: 0 0 18px; }
label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 5px; }
input[type=email] { width: 100%; padding: 9px 12px; border: 1px solid var(--line);
border-radius: 9px; font: inherit; font-size: .9rem; }
.field { margin-bottom: 14px; }
.btn { background: var(--brand); color: #fff; border: 0; border-radius: 9px;
padding: 11px 20px; font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer;
width: 100%; }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 20px; background: #f6faf9; }
.muted { color: var(--muted); font-size: .85rem; }
</style>
</head>
<body>
<h1>Passwort vergessen</h1>
{% if sent %}
<div class="card">
<p>Wenn zu dieser E-Mail-Adresse ein Konto existiert, wurde ein Link zum Zurücksetzen
des Passworts versendet.</p>
<p class="muted">Bitte prüfen Sie Ihren Posteingang.</p>
</div>
{% else %}
<form method="post">
<div class="field">
<label for="email">E-Mail</label>
<input type="email" id="email" name="email" required autocomplete="username" />
</div>
<button class="btn" type="submit">Link anfordern</button>
</form>
{% endif %}
</body>
</html>
+48
View File
@@ -0,0 +1,48 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="robots" content="noindex" />
<title>Anmelden</title>
<style>
:root {
--brand: #0f8a7e;
--bg: #fff; --ink: #16302f; --muted: #5d716f; --line: #e3eae9;
--danger: #b3261e; --danger-bg: #fdecea;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
background: var(--bg); color: var(--ink); padding: 20px; max-width: 380px; }
h1 { font-size: 1.2rem; margin: 0 0 18px; }
label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 5px; }
input[type=email], input[type=password] {
width: 100%; padding: 9px 12px; border: 1px solid var(--line);
border-radius: 9px; font: inherit; font-size: .9rem; }
.field { margin-bottom: 14px; }
.btn { background: var(--brand); color: #fff; border: 0; border-radius: 9px;
padding: 11px 20px; font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer;
width: 100%; }
.error { background: var(--danger-bg); color: var(--danger); border-radius: 9px;
padding: 10px 14px; font-size: .88rem; margin-bottom: 14px; }
.muted { color: var(--muted); font-size: .85rem; margin-top: 14px; }
a { color: var(--brand); }
</style>
</head>
<body>
<h1>Anmelden</h1>
{% if error %}<div class="error">{{ error }}</div>{% endif %}
<form method="post">
<div class="field">
<label for="email">E-Mail</label>
<input type="email" id="email" name="email" required autocomplete="username" />
</div>
<div class="field">
<label for="password">Passwort</label>
<input type="password" id="password" name="password" required autocomplete="current-password" />
</div>
<button class="btn" type="submit">Anmelden</button>
</form>
<p class="muted"><a href="{{ url_for('owner_auth.forgot_password') }}">Passwort vergessen?</a></p>
</body>
</html>
@@ -0,0 +1,51 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="robots" content="noindex" />
<title>Passwort zurücksetzen</title>
<style>
:root {
--brand: #0f8a7e;
--bg: #fff; --ink: #16302f; --muted: #5d716f; --line: #e3eae9;
--danger: #b3261e; --danger-bg: #fdecea;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
background: var(--bg); color: var(--ink); padding: 20px; max-width: 380px; }
h1 { font-size: 1.2rem; margin: 0 0 18px; }
label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 5px; }
input[type=password] { width: 100%; padding: 9px 12px; border: 1px solid var(--line);
border-radius: 9px; font: inherit; font-size: .9rem; }
.field { margin-bottom: 14px; }
.btn { background: var(--brand); color: #fff; border: 0; border-radius: 9px;
padding: 11px 20px; font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer;
width: 100%; }
.error { background: var(--danger-bg); color: var(--danger); border-radius: 9px;
padding: 10px 14px; font-size: .88rem; margin-bottom: 14px; }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 20px; background: #f6faf9; }
.muted { color: var(--muted); font-size: .85rem; }
a { color: var(--brand); }
</style>
</head>
<body>
<h1>Passwort zurücksetzen</h1>
{% if done %}
<div class="card">
<p>Ihr Passwort wurde geändert.</p>
<p class="muted"><a href="{{ url_for('owner_auth.login') }}">Jetzt anmelden</a></p>
</div>
{% else %}
{% if error %}<div class="error">{{ error }}</div>{% endif %}
<form method="post">
<div class="field">
<label for="password">Neues Passwort</label>
<input type="password" id="password" name="password" required minlength="8"
autocomplete="new-password" />
</div>
<button class="btn" type="submit">Passwort speichern</button>
</form>
{% endif %}
</body>
</html>