From 53d0ca90a5260b41a609d465efc9b4d1c0e76a55 Mon Sep 17 00:00:00 2001 From: hypax Date: Sun, 15 Nov 2026 02:30:55 +0100 Subject: [PATCH] Drop the Discord and Sync button from the login page in the game Without a session the ef_bridge tablet shows the normal login page. Its button, and the registration code form, lead to Discord or to the fabrica authorize endpoint, and both refuse to be framed (X-Frame-Options DENY, frame-ancestors 'none'). CEF shows no error page for that, so the tablet frame stayed dark until the resource restarted. For a CitizenFX user agent the page now leaves out the button, the code form and the registration notes, and tells the player that the tablet signs them in and to reopen it if that fails. The signal to ef_bridge stays. --- login.php | 15 ++++++++++++--- tests/Feature/TabletLoginTest.php | 13 +++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/login.php b/login.php index 1fcae620..9c860352 100644 --- a/login.php +++ b/login.php @@ -24,6 +24,8 @@ $centralLogin = \App\Auth\FabricaClient::enabled(); $registrationMode = defined('REGISTRATION_MODE') ? REGISTRATION_MODE : 'open'; $error = \App\Session\SessionManager::pullRegistrationError(); +// Discord and Sync forbid framing: in the ef_bridge tablet their button only led to a black frame. +$inGame = \App\Http\FiveMSupport::isCitizenFx(); // Handle code submission if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['registration_code'])) { @@ -76,7 +78,11 @@

Willkommen zurück

- + + + + + '; echo '
Registrierung für neue Benutzer ist derzeit geschlossen.
'; echo '
'; - } elseif ($registrationMode === 'code') { + } elseif (!$inGame && $registrationMode === 'code') { if (!$error) { echo ' assertStringContainsString('ef_tablet_signed_out', $this->get('/login')->body); } + #[Test] + public function im_spiel_zeigt_die_login_seite_keinen_discord_oder_sync_knopf(): void + { + $this->assertStringContainsString('auth/discord', $this->get('/login')->body); + + // Discord and Sync refuse to be framed, the tablet would turn black. + $game = $this->get('/login', ['headers' => ['User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.134 CitizenFX/1.0.0.12345 Safari/537.36']])->body; + $this->assertStringNotContainsString('auth/discord', $game); + $this->assertStringNotContainsString('auth/fabrica', $game); + $this->assertStringContainsString('schließe das Tablet und öffne es erneut', $game); + $this->assertStringContainsString('ef_tablet_signed_out', $game); + } + #[Test] public function ein_abgelaufener_oder_fremder_token_meldet_nicht_an(): void {