From ed329f9d05df0ec85ed0a5db3d1ac608587803dd Mon Sep 17 00:00:00 2001 From: davegilligan Date: Thu, 21 May 2026 08:16:14 +0200 Subject: [PATCH] Redirect authenticated users from landing page to dashboard Logged-in users visiting tools.dobetternorge.no were landing on /#access (the unauthenticated marketing view). Now they go straight to /dashboard.php. Co-Authored-By: Claude Sonnet 4.6 --- index.php | 35 +++++++++++------------------------ 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/index.php b/index.php index 5e29503..ffc18a2 100644 --- a/index.php +++ b/index.php @@ -45,11 +45,18 @@ if (isset($_GET['sso']) && !dbnToolsIsAuthenticated()) { } $isAuthed = dbnToolsIsAuthenticated(); -$userEmail = $isAuthed ? (string)($_SESSION['dbn_tools_user_email'] ?? '') : ''; + +// Authenticated users have no reason to see the marketing landing page. +if ($isAuthed) { + header('Location: /dashboard.php'); + exit; +} + +$userEmail = ''; $tools = dbnToolsLaunchedTools($uiLang); $workbench = dbnToolsWorkbenchMeta($uiLang); $langPath = '/'; -$toolsLogin = 'https://dobetternorge.no/tools-login.php?return=' . urlencode($returnPath); +$toolsLogin = 'https://dobetternorge.no/tools-login.php?return=' . urlencode('/dashboard.php'); $registerUrl = 'https://dobetternorge.no/register.php'; require_once __DIR__ . '/includes/tool-svgs.php'; @@ -96,14 +103,7 @@ window.DBN_TOOLS_LANG = ; - -
- - -
- - @@ -130,15 +130,7 @@ window.DBN_TOOLS_LANG = ; - -
- - - -
- - @@ -164,7 +156,7 @@ window.DBN_TOOLS_LANG = ;

$item): ?> @@ -189,11 +181,6 @@ window.DBN_TOOLS_LANG = ; - -
- -
-