1import{a as l,c as d,r as c,j as t}from"./index-BsqGAfoC.js";const m="https://andgo-platform-api-306577184879.australia-southeast1.run.app";function p(){const[r]=l(),s=d(),[n,o]=c.useState(null);return c.useEffect(()=>{const i=r.get("code");if(!i){o("No SSO code provided");return}fetch(`${m}/api/sso/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:i})}).then(a=>{if(!a.ok)throw new Error("SSO exchange failed");return a.json()}).then(async({customToken:a,user:e})=>{a&&localStorage.setItem("access_token",a),localStorage.setItem("is_logged_in","true"),localStorage.setItem("user_email",(e==null?void 0:e.email)||""),localStorage.setItem("user_display_name",(e==null?void 0:e.displayName)||(e==null?void 0:e.name)||""),localStorage.setItem("is_admin","true"),localStorage.setItem("auth_source","platform_sso"),s("/dashboard",{replace:!0})}).catch(a=>{console.error("SSO failed:",a),o("Sign-in failed. Please try again."),setTimeout(()=>s("/login",{replace:!0}),3e3)})},[r,s]),n?t.jsx("div",{className:"flex items-center justify-center min-h-screen",children:t.jsx("p",{className:"text-red-500",children:n})}):t.jsx("div",{className:"flex items-center justify-center min-h-screen",children:t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"w-10 h-10 border-4 border-blue-600 border-t-transparent rounded-full animate-spin mx-auto mb-4"}),t.jsx("p",{className:"text-slate-500",children:"Signing you in via MyAndGo..."})]})})}export{p 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.