shoc-frontend-new/src/lib/auth/expire-session.ts
Arthur Bassi 74e5c58e5d fix(work-orders): restore completion media uploads over HTTP/1.1
Use XHR for media progress so Ky does not stream the body on HTTP/1.1
(Vite proxy), and keep completion vs extra tiles from mixing after upload.
2026-09-07 15:19:39 -03:00

12 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");
}
}