This commit is contained in:
Timothy Jaeryang Baek 2026-07-15 16:26:40 -04:00
parent 609cc6ad9b
commit 29782aba01

View file

@ -843,8 +843,15 @@
}
isAuthRedirectInProgress = true;
if (tokenTimer) {
clearInterval(tokenTimer);
tokenTimer = null;
}
user.set(null);
localStorage.removeItem('token');
userSignOut().catch((error) => {
console.error('Error signing out expired session:', error);
});
toast.error($i18n.t('Session expired. Please sign in again.'));
const currentPath = `${window.location.pathname}${window.location.search}`;
@ -876,11 +883,7 @@
}
if (now >= exp - TOKEN_EXPIRY_BUFFER) {
const res = await userSignOut();
user.set(null);
localStorage.removeItem('token');
location.href = res?.redirect_url ?? '/auth';
redirectToAuthAfterUnauthorized();
}
};