fix: Prevent token race conditions by pre-saving access/refresh tokens to localStorage before NextAuth signIn and refining logout token clearing.

This commit is contained in:
pradeepkumar
2026-03-16 13:25:32 +05:30
parent 63ad223c4c
commit 1e9262edfa
4 changed files with 26 additions and 9 deletions

View File

@@ -23,11 +23,8 @@ export default function LogoutPage() {
// Delete httpOnly cookies via server action (Next.js cookies() API)
await clearAuthCookies();
setTimeout(() => {
// Redirect to login
window.location.reload();
window.location.href = '/login';
}, 3000);
// Redirect to login immediately
window.location.href = '/login';
};
performLogout().catch(() => {