1import{W as x,r as s,j as e,a9 as v,U as t,az as p}from"./index-CRQcHE7J.js";import{M as k}from"./MFAChallenge-BWMZTEOD.js";import{L as b}from"./loader-circle-C3ZGFjbj.js";import"./card-DWLMxT6t.js";import"./input-otp-CeZDOR3s.js";const N=()=>{const a=x(),[i,c]=s.useState(!0),[r,l]=s.useState(null);s.useEffect(()=>{(async()=>{const{data:{session:n}}=await t.auth.getSession();if(!n){a("/morvo-internal-9f4k2x/login");return}const{data:d}=await t.rpc("has_role",{_user_id:n.user.id,_role:"admin"});if(!d){a("/morvo-internal-9f4k2x/login");return}const{data:f}=await t.auth.mfa.getAuthenticatorAssuranceLevel();if(f?.currentLevel==="aal2"){a("/morvo-internal-9f4k2x/dashboard");return}const{data:h}=await t.auth.mfa.listFactors(),o=h?.totp.find(g=>g.status==="verified");if(!o){a("/morvo-internal-9f4k2x/mfa-setup");return}l(o.id),c(!1)})()},[a]);const u=()=>{p.success("Verification successful"),a("/morvo-internal-9f4k2x/dashboard")},m=async()=>{await t.auth.signOut(),a("/morvo-internal-9f4k2x/login")};return i?e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-background via-background to-primary/5",children:e.jsx(b,{className:"h-8 w-8 animate-spin text-primary"})}):r?e.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center bg-gradient-to-br from-background via-background to-primary/5 p-4",children:[e.jsx("div",{className:"mb-8",children:e.jsx("img",{src:v,alt:"Morvo Logo",className:"h-12"})}),e.jsx(k,{factorId:r,onSuccess:u,onCancel:m,showCancel:!0})]}):null};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.