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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user