From 61d677d8118b58842608212ba3ffdcc62864eba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20K=C3=BChn?= Date: Mon, 11 May 2026 22:55:22 +0200 Subject: [PATCH] Fix logout not showing login screen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Symfony's logout responds with a redirect, causing fetch to parse HTML as JSON and reject — .finally() ensures the UI always transitions. Co-Authored-By: Claude Sonnet 4.6 --- config/reference.php | 11 ----------- public/js/sheets.js | 2 +- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/config/reference.php b/config/reference.php index 7defcec..b89e2ae 100644 --- a/config/reference.php +++ b/config/reference.php @@ -1240,16 +1240,6 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param; * doctrine_migrations?: DoctrineMigrationsConfig, * security?: SecurityConfig, * twig?: TwigConfig, - * "when@dev"?: array{ - * imports?: ImportsConfig, - * parameters?: ParametersConfig, - * services?: ServicesConfig, - * framework?: FrameworkConfig, - * doctrine?: DoctrineConfig, - * doctrine_migrations?: DoctrineMigrationsConfig, - * security?: SecurityConfig, - * twig?: TwigConfig, - * }, * "when@prod"?: array{ * imports?: ImportsConfig, * parameters?: ParametersConfig, @@ -1352,7 +1342,6 @@ namespace Symfony\Component\Routing\Loader\Configurator; * deprecated?: array{package:string, version:string, message?:string}, * } * @psalm-type RoutesConfig = array{ - * "when@dev"?: array, * "when@prod"?: array, * "when@test"?: array, * ... diff --git a/public/js/sheets.js b/public/js/sheets.js index 6d5103f..c707c20 100644 --- a/public/js/sheets.js +++ b/public/js/sheets.js @@ -65,7 +65,7 @@ export function openData() { c.querySelector('.dm-cpw').onclick = () => { closeOv(); showChangePassword(); }; c.querySelector('.dm-lgout').onclick = () => { - api('POST', 'logout').then(() => { state.goals = []; closeOv(); render(); showLogin(); }); + api('POST', 'logout').finally(() => { state.goals = []; closeOv(); render(); showLogin(); }); }; const adminBtn = c.querySelector('.dm-admin');