mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-10-07 16:19:01 +00:00
13 lines
412 B
TypeScript
13 lines
412 B
TypeScript
|
|
import { clearAuth } from "@/lib/auth/auth-storage";
|
||
|
|
import queryClient from "@/lib/query/query-client";
|
||
|
|
import { stopQueryBroadcast } from "@/lib/query/setup-query-broadcast";
|
||
|
|
|
||
|
|
export function expireSessionAndRedirectToLogin(): void {
|
||
|
|
clearAuth();
|
||
|
|
stopQueryBroadcast(queryClient);
|
||
|
|
|
||
|
|
if (typeof window !== "undefined" && window.location.pathname !== "/login") {
|
||
|
|
window.location.replace("/login");
|
||
|
|
}
|
||
|
|
}
|