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 <noreply@anthropic.com>
This commit is contained in:
parent
dbbef4972b
commit
4b4e48be01
1 changed files with 4 additions and 3 deletions
|
|
@ -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 (
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue