From 4b4e48be0174a26f15622d0ba8e07bc0aa504f07 Mon Sep 17 00:00:00 2001 From: Vadym Samoilenko Date: Mon, 30 Mar 2026 11:14:06 +0100 Subject: [PATCH] Fix logout for MSAL v5: use clearCache() for app-only sign out onRedirectNavigate was removed from EndSessionRequest in msal-browser v3+. clearCache() clears local tokens without redirecting to Microsoft logout. Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/App.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index bb3ffec..bff2533 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -182,9 +182,10 @@ function NavBar() { const { instance, accounts } = useMsal(); const user = accounts[0]; - function handleLogout() { - // Sign out from the app only — does not sign out of the Microsoft account - instance.logoutRedirect({ onRedirectNavigate: () => false }); + async function handleLogout() { + // Clear local MSAL cache only — does not sign out of the Microsoft account + await instance.clearCache(); + window.location.href = '/gsb'; } return (