PageSourceSearch

https://mirrexa.ai/assets/OAuthCallback-BQS9qco1.js

js mirrexa.ai collected 2026-10-05 15:39:50 UTC 2,542 bytes, 1 lines download raw bytes

1import{r as a,e as g,j as e,P as n,L as f,k as w}from"./index-BrWsbXFR.js";import{T as p}from"./TwoFactorHandler-CsF7FrAS.js";import{E as b}from"./ErrorInfo-8INlVT22.js";import"./index-DwM0Lmtm.js";const N=()=>{const[o,r]=a.useState(null),[i,x]=a.useState(void 0),c=g();return a.useEffect(()=>{(async()=>{try{const t=new URLSearchParams(window.location.search),d=t.get("code"),u=t.get("state"),m=t.get("error");if(m){r(`Authentication error: ${m}`);return}if(!d||!u){r("Missing required OAuth parameters");return}const h=`${window.location.origin}/oauth-callback`,s=await w.CompleteOAuth(d,u,h);s.success&&s.message?x(s.message):r("Failed to complete authentication")}catch(t){console.error("Error during OAuth callback:",t),r("An unexpected error occurred during authentication")}})().catch(t=>{console.error("Error during OAuth callback:",t),r("An unexpected error occurred during authentication")})},[c]),o?e.jsx(n,{isCentered:!0,children:e.jsxs("div",{className:"max-w-md mx-auto my-10 p-6 bg-white rounded-lg shadow-md space-y-4",children:[e.jsx("h2",{className:"text-xl md:text-2xl font-bold w-full md:w-auto text-blue-600 text-center",children:"Authentication Error"}),o&&e.jsx(b,{error:o}),e.jsx("div",{className:"mt-5",children:e.jsx(f,{to:"/login",className:"group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",children:"Return to Login"})})]})}):i?e.jsx(n,{isCentered:!0,children:e.jsxs("div",{className:"max-w-md mx-auto my-10 p-6 bg-white rounded-lg shadow-md space-y-4",children:[e.jsx("h2",{className:"text-xl md:text-2xl font-bold w-full md:w-auto text-blue-600 text-center",children:"Authentication Error"}),e.jsx(p,{twoFactorInitiateResponse:i,onLoginSuccess:async()=>await c("/user/dashboard"),onLoginError:async l=>(r(l||"Failed to complete authentication"),Promise.resolve())})]})}):e.jsx(n,{isCentered:!0,children:e.jsxs("div",{className:"max-w-md mx-auto my-10 p-6 bg-white rounded-lg shadow-md space-y-4",children:[e.jsx("h2",{className:"text-xl md:text-2xl font-bold w-full md:w-auto text-blue-600 text-center",children:"Authenticating"}),e.jsx("p",{className:"mt-2 text-sm text-gray-600",children:"Please wait while we complete your sign in..."}),e.jsx("div",{className:"mt-5 flex justify-center",children:e.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-indigo-500"})})]})})};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.