1import{z as m,A as x,u as f,r as c,j as t,E as d,aa as g,ab as h,ac as p}from"./index-CXUX1T7T.js";const N=()=>{const s=m(),{login:o}=x(),{language:r}=f(),i=c.useRef(!1),[l,u]=c.useState(null);return c.useEffect(()=>{if(i.current)return;i.current=!0,(async()=>{try{const a=g(window.location.hash);if(!a){u("No access token found in callback URL");return}const n=await h(a),e=await p(a);o({accessToken:e.accessToken,refreshToken:e.refreshToken,userName:e.userName||n.name,userEmail:e.email||n.email,avatar:e.avatar||n.picture,expiredAt:typeof e.expiredAt=="string"?new Date(e.expiredAt).getTime():e.expiredAt}),s(d("/",r),{replace:!0})}catch(a){u(a instanceof Error?a.message:"Login failed")}})()},[o,s,r]),l?t.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 px-4 text-center",children:[t.jsx("p",{className:"text-lg font-medium text-destructive",children:"Login failed"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:l}),t.jsx("button",{onClick:()=>s(d("/",r),{replace:!0}),className:"text-sm text-primary underline",children:"Back to home"})]}):t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-3",children:[t.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Signing you inâ¦"})]})})};export{N as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.