feat: implement cross-tab logout synchronization using storage event broadcasting
This commit is contained in:
@@ -13,6 +13,9 @@ export default function LogoutPage() {
|
||||
localStorage.setItem('isLoggingOut', 'true');
|
||||
localStorage.removeItem('accessToken');
|
||||
localStorage.removeItem('refreshToken');
|
||||
// Broadcast to other open tabs so they also log out.
|
||||
// 'storage' events only fire in OTHER tabs, not the one that wrote the value.
|
||||
localStorage.setItem('re-quest-logout-broadcast', String(Date.now()));
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user