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
+32
View File
@@ -0,0 +1,32 @@
"""Owner password-reset email (#19), following the same
sender-resolution/template/mailer.send_email shape as booking_mail.py's
booking confirmation -- see that module for why this never talks to smtplib
directly.
"""
import os
from flask import render_template
import booking_mail
import mailer
PUBLIC_BASE_URL = os.environ.get("PUBLIC_BASE_URL", "https://onboard.mivanchenko.de").rstrip("/")
def reset_url(token):
return f"{PUBLIC_BASE_URL}/owner/reset-password/{token}"
def send_password_reset(client, user, token):
business_name = (client or {}).get("business_name") or "Ihr Konto"
html = render_template(
"emails/password_reset.html",
business_name=business_name,
reset_url=reset_url(token),
)
mailer.send_email(
user["email"],
f"Passwort zurücksetzen {business_name}",
html,
from_addr=booking_mail._sender_for(client),
)