feat: add text color
This commit is contained in:
@@ -98,9 +98,19 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
|
||||
}
|
||||
}
|
||||
|
||||
// Clear localStorage
|
||||
localStorage.removeItem('auth_token');
|
||||
localStorage.removeItem('auth_user');
|
||||
|
||||
// Clear cookie - multiple methods to ensure it's removed
|
||||
document.cookie = 'auth_token=; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT; SameSite=Strict';
|
||||
document.cookie = 'auth_token=; path=/admin; expires=Thu, 01 Jan 1970 00:00:01 GMT; SameSite=Strict';
|
||||
|
||||
// Alternative: Clear all cookies
|
||||
document.cookie.split(";").forEach(function (c) {
|
||||
document.cookie = c.replace(/^ +/, "").replace(/=.*/, "=; path=/; expires=" + new Date().toUTCString() + ";");
|
||||
});
|
||||
|
||||
setState({
|
||||
user: null,
|
||||
token: null,
|
||||
@@ -108,7 +118,9 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
|
||||
error: null,
|
||||
});
|
||||
|
||||
router.push('/admin/login');
|
||||
// Force hard navigation instead of router.push
|
||||
window.location.href = '/admin/login';
|
||||
// router.push('/admin/login');
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user