async function s(n,e={}){const t=localStorage.getItem("jivas-token"),o=new Headers(e.headers);t&&o.set("Authorization",`Bearer ${t}`);const a=await fetch(n,{...e,headers:o});if(a.status===401)throw localStorage.removeItem("jivas-token"),localStorage.removeItem("jivas-token-exp"),window.location.pathname!=="/login"&&(window.location.href="/login"),new Response("Unauthorized",{status:401});return a}export{s as f};
