fix: robust logout session clearing with cookie cleanup and isLoggingOut guard

- Clear next-auth session cookies directly as backup in logout page
- Add isLoggingOut localStorage flag to prevent TokenSync/PresenceProvider from restoring tokens
- Clear isLoggingOut flag on login page load as safety net
- Add createdAt to AgentSubscription interface (fixes build error)
- Add /education to public routes in middleware
This commit is contained in:
pradeepkumar
2026-03-08 12:06:07 +05:30
parent 8c499ecc6a
commit b49b07fdd6
10 changed files with 64 additions and 17 deletions

View File

@@ -13,6 +13,11 @@ export default function LoginPage() {
const [error, setError] = useState('');
const [loading, setLoading] = useState(false);
// Safety net: clear logout flag when login page loads
if (typeof window !== 'undefined') {
localStorage.removeItem('isLoggingOut');
}
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
setLoading(true);