From 22d89df8ef112cd69224b8edbf91a60b4e1172f4 Mon Sep 17 00:00:00 2001 From: Luca Haid Date: Mon, 8 Sep 2025 16:43:24 +0200 Subject: [PATCH] fixed bugs --- .../default/VueViews/WorkorderCompanyPWA.php | 763 +++++++----------- public/js/pages/WorkorderBase/manifest.json | 2 +- 2 files changed, 284 insertions(+), 481 deletions(-) diff --git a/Layout/default/VueViews/WorkorderCompanyPWA.php b/Layout/default/VueViews/WorkorderCompanyPWA.php index d2bf0fe3a..4c365e84e 100644 --- a/Layout/default/VueViews/WorkorderCompanyPWA.php +++ b/Layout/default/VueViews/WorkorderCompanyPWA.php @@ -1,4 +1,51 @@ performLogin($username, $password, $code2fa, $remember); + } + } + + $loginController = new PwaLoginController(); + + $username = $_POST['Username'] ?? ''; + $password = $_POST['Password'] ?? ''; + $twoFactorCode = isset($_POST['TwofactorCode']) && is_numeric($_POST['TwofactorCode']) ? (int)$_POST['TwofactorCode'] : 'unset'; + $remember = isset($_POST['Remember']) && $_POST['Remember'] === 'true'; + + $result = $loginController->apiLogin($username, $password, $twoFactorCode, $remember); + + $response = ['status' => 'error', 'message' => 'Anmeldung fehlgeschlagen.']; + + if ($result === true) { + $response = ['status' => 'success']; + } elseif ($result === '2fa') { + $response = ['status' => '2fa_required']; + } elseif ($result === 'false2fa') { + $response = ['status' => 'invalid_2fa', 'message' => 'Verifizierungscode falsch oder abgelaufen.']; + } else { + $response['message'] = 'Benutzername oder Passwort ist falsch.'; + } + + echo json_encode($response); + exit; // Stop execution to prevent rendering the full HTML page. +} + +// --- HTML & Vue App Rendering --- ?> @@ -9,11 +56,9 @@ - - @@ -23,12 +68,12 @@ window.TT_CONFIG = ; moment.locale('de'); tailwind.config = { - darkMode: 'class', // Enable dark mode based on a class + darkMode: 'class', theme: { extend: { colors: { - 'primary': '#005384', // Dark Blue - 'secondary': '#fac41b', // Yellow/Gold + 'primary': '#005384', + 'secondary': '#fac41b', }, } } @@ -36,54 +81,29 @@ - + -
+