PageSourceSearch

https://app.leadlock.ai/assets/SSOLanding-CqSQp0SO.js

js leadlock.ai collected 2026-10-05 12:09:39 UTC 4,621 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-utils-BRPr2gEl.js";import{r as a,c as y}from"./vendor-react-C7XoiZkC.js";import{b as S,d as b}from"./index-7lVs2FEF.js";import"./vendor-ui-CMNM5ZVP.js";const N=1e4;function g(s,t){try{localStorage.setItem(s,t)}catch{}}function p(s,t){try{localStorage.setItem(s,JSON.stringify(t))}catch{}}const o=window.parent!==window;function L(){const[s,t]=a.useState(o?"connecting":"error"),[w,i]=a.useState(o?"":"This page must be opened from within a supported platform."),d=y(),r=a.useRef(!o);return a.useEffect(()=>{if(!o)return;const m=setTimeout(()=>{r.current||(r.current=!0,t("timeout"))},N),u=async c=>{var x;if(!c.data||c.data.message!=="REQUEST_USER_DATA_RESPONSE"||r.current)return;r.current=!0,clearTimeout(m);const h=c.data.payload;if(!h){t("error"),i("No user data received from the platform.");return}t("authenticating");try{const l=await fetch(`${S}/auth/embed-sso`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({payload:h})});if(!l.ok){const f=await l.json().catch(()=>({})),k=f.detail||((x=f.error)==null?void 0:x.message)||"Authentication failed";t("error"),i(k);return}const n=await l.json();g("leadlock_access_token",n.access_token),g("leadlock_refresh_token",n.refresh_token),p("leadlock_cached_user",n.user),p("leadlock_cached_tenant",n.tenant),b.getState().setAuth({accessToken:n.access_token,refreshToken:n.refresh_token,user:n.user,tenant:n.tenant}),t("success"),setTimeout(()=>d("/dashboard",{replace:!0}),300)}catch{t("error"),i("Network error. Please try again.")}};return window.addEventListener("message",u),window.parent.postMessage({message:"REQUEST_USER_DATA"},"*"),()=>{clearTimeout(m),window.removeEventListener("message",u)}},[d]),e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:e.jsxs("div",{className:"text-center max-w-md px-6",children:[e.jsx("div",{className:"mb-8",children:e.jsx("span",{className:"text-2xl font-bold tracking-widest text-white uppercase",children:"LEADLOCK"})}),s==="connecting"&&e.jsxs(e.Fragment,{children:[e.jsx(j,{}),e.jsx("p",{className:"text-text-secondary mt-4",children:"Connecting..."})]}),s==="authenticating"&&e.jsxs(e.Fragment,{children:[e.jsx(j,{}),e.jsx("p",{className:"text-text-secondary mt-4",children:"Signing you in..."})]}),s==="success"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-12 h-12 mx-auto rounded-full bg-green-500/10 flex items-center justify-center",children:e.jsx("svg",{className:"w-6 h-6 text-green-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),e.jsx("p",{className:"text-text-secondary mt-4",children:"Authenticated! Redirecting..."})]}),s==="timeout"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-12 h-12 mx-auto rounded-full bg-yellow-500/10 flex items-center justify-center",children:e.jsx("svg",{className:"w-6 h-6 text-yellow-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})})}),e.jsx("p",{className:"text-white font-medium mt-4",children:"SSO Connection Timed Out"}),e.jsx("p",{className:"text-text-secondary text-sm mt-2",children:"Could not connect to the platform. You can sign in manually."}),e.jsx("a",{href:"/login",className:"inline-block mt-6 px-6 py-2.5 bg-white text-black rounded-xl text-sm font-medium hover:bg-white/90 transition-colors",children:"Sign in manually"})]}),s==="error"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-12 h-12 mx-auto rounded-full bg-red-500/10 flex items-center justify-center",children:e.jsx("svg",{className:"w-6 h-6 text-red-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),e.jsx("p",{className:"text-white font-medium mt-4",children:"Authentication Failed"}),e.jsx("p",{className:"text-text-secondary text-sm mt-2",children:w}),e.jsx("a",{href:"/login",className:"inline-block mt-6 px-6 py-2.5 bg-white text-black rounded-xl text-sm font-medium hover:bg-white/90 transition-colors",children:"Sign in manually"})]})]})})}function j(){return e.jsxs("div",{className:"relative mx-auto w-12 h-12",children:[e.jsx("div",{className:"h-12 w-12 rounded-full border-t-2 border-b-2 border-accent animate-spin"}),e.jsx("div",{className:"absolute inset-0 h-12 w-12 rounded-full border-t-2 border-b-2 border-accent animate-spin blur-sm op
1acity-50"})]})}export{L 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.