Kundenkuerzel aus Login und Passwort-vergessen entfernen

Das Feld war optional und musste vom Kunden auswendig gewusst werden.
Ohne Einschraenkung liefert saas_authenticate() bei mehreren Mandanten
needs_tenant_selection, und mandant-auswahl.php laesst per Klarnamen
waehlen - der kundenfreundlichere Weg. Beim Passwort-Reset haengt das
Passwort ohnehin am Benutzerkonto, nicht am Mandanten.

Die optionalen Parameter von saas_authenticate() und
saas_request_password_reset() bleiben erhalten; die check-*-Skripte
pruefen darueber weiterhin die mandantenspezifische Aufloesung.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-23 20:45:44 +02:00
co-authored by Claude Opus 5
parent 93d6bd9127
commit 47dff5a1ca
2 changed files with 8 additions and 13 deletions
+4 -7
View File
@@ -6,7 +6,6 @@ require_once __DIR__ . '/app/rate-limit.php';
$pdo = app_db_pdo();
$errors = [];
$email = trim((string)($_POST['email'] ?? ''));
$tenantSlug = trim((string)($_POST['tenant_slug'] ?? ''));
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
app_require_csrf();
@@ -17,11 +16,13 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (!$emailBucketOk || !$ipBucketOk) {
$errors = ['Zu viele Anmeldeversuche. Bitte versuche es in einigen Minuten erneut.'];
} else {
// Bewusst ohne Mandanten-Einschraenkung: gehoert die E-Mail zu
// mehreren Mandanten, uebernimmt mandant-auswahl.php die Auswahl per
// Klarnamen. Ein Kundenkuerzel muss dafuer niemand kennen.
$result = saas_authenticate(
$pdo,
$email,
(string)($_POST['password'] ?? ''),
$tenantSlug
(string)($_POST['password'] ?? '')
);
if ($result['ok'] && !empty($result['needs_tenant_selection'])) {
@@ -96,10 +97,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
<label for="password">Passwort</label>
<input type="password" name="password" id="password" required>
</div>
<div class="col-12">
<label for="tenant_slug">Kundenkürzel</label>
<input type="text" name="tenant_slug" id="tenant_slug" value="<?php echo saas_html($tenantSlug); ?>" placeholder="optional">
</div>
</div>
<ul class="actions">
<li><button type="submit" class="primary">Einloggen</button></li>
+4 -6
View File
@@ -6,7 +6,6 @@ require_once __DIR__ . '/app/rate-limit.php';
$pdo = app_db_pdo();
$email = trim((string)($_POST['email'] ?? ''));
$tenantSlug = trim((string)($_POST['tenant_slug'] ?? ''));
$errors = [];
$message = '';
$resetLink = null;
@@ -22,7 +21,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
// ausgereiztes Limit nicht verrät, ob das Konto existiert.
$message = 'Wenn ein passendes Konto existiert, wurde ein Link vorbereitet.';
} else {
$result = saas_request_password_reset($pdo, $email, $tenantSlug);
// Ohne Kundenkuerzel: das Passwort haengt am Benutzerkonto, nicht am
// Mandanten - ein Reset gilt daher ohnehin fuer alle Mandanten, zu
// denen die E-Mail gehoert.
$result = saas_request_password_reset($pdo, $email);
if ($result['ok']) {
$message = $result['message'];
@@ -93,10 +95,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
<label for="email">E-Mail</label>
<input type="email" name="email" id="email" value="<?php echo saas_html($email); ?>" required>
</div>
<div class="col-12">
<label for="tenant_slug">Kundenkürzel</label>
<input type="text" name="tenant_slug" id="tenant_slug" value="<?php echo saas_html($tenantSlug); ?>" placeholder="optional">
</div>
</div>
<ul class="actions">
<li><button type="submit" class="primary">Link vorbereiten</button></li>