+6
public/index.tsx
+6
public/index.tsx
···
321
321
window.location.href = '/editor'
322
322
return
323
323
}
324
+
// If not authenticated, clear any stale cookies
325
+
document.cookie = 'did=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT; SameSite=Lax'
324
326
} catch (error) {
325
327
console.error('Auth check failed:', error)
328
+
// Clear cookies on error as well
329
+
document.cookie = 'did=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT; SameSite=Lax'
326
330
} finally {
327
331
setCheckingAuth(false)
328
332
}
···
455
459
'Login failed:',
456
460
error
457
461
)
462
+
// Clear any invalid cookies
463
+
document.cookie = 'did=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT; SameSite=Lax'
458
464
alert('Authentication failed')
459
465
}
460
466
}}