diff --git a/frontend/lib/store.ts b/frontend/lib/store.ts index 3c6c590..7754982 100644 --- a/frontend/lib/store.ts +++ b/frontend/lib/store.ts @@ -51,10 +51,12 @@ export const useAuthStore = create()( if (typeof window !== 'undefined') { localStorage.removeItem('access_token'); localStorage.removeItem('refresh_token'); - // Clear the auth cookie so middleware stops treating this session as logged in. document.cookie = 'access_token=; path=/; max-age=0'; } set({ accessToken: null, refreshToken: null, user: null }); + if (typeof window !== 'undefined') { + window.location.href = '/login'; + } }, }), { name: 'cu-points-auth' }