From 576841cc96d0935fa5cec7ded809cdfb307e7067 Mon Sep 17 00:00:00 2001 From: Michael Abebe Date: Mon, 18 May 2026 17:00:45 +0300 Subject: [PATCH] fix(portal:auth): auth portal redirect fixed --- apps/edr-freight-web/portal/src/App.tsx | 11 ++++++++--- apps/edr-freight-web/portal/src/main.tsx | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/apps/edr-freight-web/portal/src/App.tsx b/apps/edr-freight-web/portal/src/App.tsx index 09cd860fc..030da4178 100644 --- a/apps/edr-freight-web/portal/src/App.tsx +++ b/apps/edr-freight-web/portal/src/App.tsx @@ -74,10 +74,14 @@ const App = () => { const userEmail = user?.email; const handleLogout = () => { - // Best-effort server-side session invalidation; local cleanup always runs - // so a failed API call (e.g. expired token) never leaves the user stuck. logout(); - ["auth-token", "refresh-token"].forEach((name) => { + [ + "auth-token", + "refresh-token", + "auth-user", + "current-position-id", + "selected-position-id", + ].forEach((name) => { document.cookie = `${name}=; Max-Age=0; path=/`; }); localStorage.clear(); @@ -113,6 +117,7 @@ const App = () => { path="/admin/dropdowns" element={} /> + } /> } /> diff --git a/apps/edr-freight-web/portal/src/main.tsx b/apps/edr-freight-web/portal/src/main.tsx index b5c8c3a6f..d0a07ba14 100644 --- a/apps/edr-freight-web/portal/src/main.tsx +++ b/apps/edr-freight-web/portal/src/main.tsx @@ -50,7 +50,7 @@ window.__USER_MANAGEMENT_BRANDING__ = { organizationName: "EDR Platform", appName: "EDR Portal", moduleBasePath: "/user-management", - backToAppPath: "/dashboard", + backToAppPath: "/", backToAppLabel: "Back to dashboard", };