fix: 배포 후 관리자 세션 복구 처리
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
window.taxbaikAdminSession = {
|
||||
clearAuthToken: function () {
|
||||
try {
|
||||
localStorage.removeItem('auth_token');
|
||||
} catch {
|
||||
// Ignore storage errors; redirect still recovers the session.
|
||||
}
|
||||
},
|
||||
watchReconnect: function () {
|
||||
const modal = document.getElementById('components-reconnect-modal');
|
||||
if (!modal) {
|
||||
return;
|
||||
}
|
||||
|
||||
const reloadOnRejectedCircuit = () => {
|
||||
const className = modal.className || '';
|
||||
if (className.includes('components-reconnect-failed') ||
|
||||
className.includes('components-reconnect-rejected')) {
|
||||
window.setTimeout(() => window.location.reload(), 1500);
|
||||
}
|
||||
};
|
||||
|
||||
new MutationObserver(reloadOnRejectedCircuit)
|
||||
.observe(modal, { attributes: true, attributeFilter: ['class'] });
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user