This commit is contained in:
IGNY8 VPS (Salman)
2025-12-08 07:47:01 +00:00
parent 42d04fb7f2
commit 40b7aced14
10 changed files with 172 additions and 44 deletions

View File

@@ -114,6 +114,11 @@ export const useAuthStore = create<AuthState>()(
},
logout: () => {
// Clear cookies (session contamination protection)
document.cookie.split(";").forEach((c) => {
document.cookie = `${c.split("=")[0].trim()}=;expires=Thu, 01 Jan 1970 00:00:00 UTC;path=/`;
});
localStorage.clear();
set({ user: null, token: null, refreshToken: null, isAuthenticated: false, loading: false });
},