PageSourceSearch

https://www.tokenpost.com/assets/MfaAuthEnrollmentFlowScreen-wOGkgs8h-C--dHo9g.js

js tokenpost.com collected 2026-09-25 19:01:58 UTC 5,206 bytes, 1 lines download raw bytes

1import{r as m,j as e}from"./index-7WnyX64m.js";import{L as x,i as j,F as P,b as F}from"./ModalFooter-Dgk75taJ-yQvQw617.js";import{F as G}from"./ShieldCheckIcon-DUv3MR-F.js";import{dE as J,d8 as Q,d9 as X,dx as Y}from"./PrivyWallet-B57uYG1D.js";import{o as Z,f as _,s as ee,i as te}from"./EnrollTotp-Y0X023TU-BI8dC7Tr.js";import{o as oe,p as re,w as b,l as C,d as R,m as S}from"./PinInput-DbZ0b1i1-BaxwUhmd.js";import"./QrCode-BCA-TcDO-CCnfxdsx.js";import"./FingerPrintIcon-DirljpeN.js";import"./PhoneIcon-CyJcZXag.js";import"./Chip-CZKIKt9K-B2KdWgHT.js";import"./LoadingSkeleton-BMsgO5PV-CmMiTSGB.js";import"./ErrorScreen-ali3Nodt-D9EjCLHd.js";import"./reservoir-x-nGuZkT-COmsmNK6.js";import"./safe-url-D7SRPu33-A8zMgOTd.js";import"./ScreenLayout-BAaQVxl--VJCgyXQE.js";import"./Screen-u_C2Hkch-DpZqSY30.js";import"./index-CWARkn2w-DIPPjhLs.js";import"./triangle-alert-C3Su7sFf.js";import"./createLucideIcon-C1NbRZnd.js";import"./lock-CekGX5k2.js";import"./LinkPasskeyScreen-BDbH74WG-BOnBNLrw.js";import"./TodoList-DnyULl18-Bc4bYicI.js";import"./x-CNvhCcV1.js";import"./check-DRaXnKYU.js";import"./circle-check-big-DfcHLx8a.js";import"./fingerprint-pattern-B1fdrD6b.js";import"./CopyToClipboard-i_OQSBJr-3scsYcMg.js";import"./Layouts-BMRfo5hw-CbD-JBl6.js";import"./LabelXs-oqZNqbm_-6DCgXlNV.js";import"./Subtitle-CV-2yKE4-C9KOJj5s.js";import"./Title-BnzYV3Is-rP3Nh1e4.js";import"./shared-FM0rljBt-C4K1drEO.js";import"./dijkstra-COg3n3zL.js";const We={component:()=>{let{user:o,ready:A}=J(),{data:c,onUserCloseViaDialogOrKeybindRef:L}=Q(),a=X(),[v,l]=m.useState(null),[h,f]=m.useState(null),[g,k]=m.useState(null),[W,O]=m.useState(!1),[E,i]=m.useState(!1),[y,s]=m.useState(),n=async()=>{y?M(y):o?await u({user:o}):M(Error("Must be logged in to manage MFA")),setTimeout((()=>{l(null),f(null)}),500)};if(L.current=n,!(c!=null&&c.mfaEnroll))throw Error("Missing modal data for MFA enrollment screen.");let{onFailure:M,onSuccess:u,onBack:w,mfaMethods:D,verify:T,generateTotpSecret:H,enrollTotp:I,unenrollTotp:K,enrollPasskey:$}=c.mfaEnroll,N=o==null?void 0:o.mfaMethods.includes("sms"),V=o==null?void 0:o.mfaMethods.includes("totp"),q=o==null?void 0:o.mfaMethods.includes("passkey"),z=!!(o!=null&&o.phone),B=(o==null?void 0:o.linkedAccounts.filter((t=>t.type==="passkey")).map((t=>t.credentialId)))??[];function d(){l(null),f(null),s(void 0)}async function U(t=B){try{s(void 0),i(!0);let r=await $(t);return await u({user:r})}catch(r){s(r)}finally{i(!1),O(!1)}}if(!A||!o||!a)return e.jsxs(e.Fragment,{children:[e.jsx(x,{onClose:n,backFn:w},"header"),e.jsx(oe,{children:e.jsx(Z,{})}),e.jsx(re,{children:e.jsx(Y,{})}),e.jsx(j,{})]});if(v==="sms")return null;if(v==="totp")return e.jsxs(e.Fragment,{children:[e.jsx(x,{backFn:d,onClose:n},"header"),e.jsx(b,{style:{marginBottom:"1.5rem"},children:e.jsx(P,{})}),e.jsx(C,{children:"Remove authenticator app verification?"}),e.jsxs(R,{children:["MFA adds an extra layer of security to your ",a==null?void 0:a.name," account. Make sure you have other methods to secure your account."]}),e.jsx(S,{children:e.jsx(F,{$warn:!0,onClick:async function(){try{s(void 0),i(!0);let t=await K();return await u({user:t})}catch(t){s(t)}finally{i(!1),l(null)}},loading:E,children:"Remove"})}),e.jsx(j,{})]});if(v==="passkey"){let t=c.mfaEnroll.shouldUnlinkOnUnenrollMfa??!0;return e.jsxs(e.Fragment,{children:[e.jsx(x,{backFn:d,onClose:n},"header"),e.jsx(b,{style:{marginBottom:"1.5rem"},children:e.jsx(P,{})}),e.jsx(C,{children:"Are you sure you want to remove this passkey?"}),e.jsx(R,{children:t?"Removing your passkey will remove as both a verification method and a login method.":"Removing your passkey will remove as a verification method."}),e.jsx(S,{children:e.jsx(F,{$warn:!0,onClick:async function(){try{s(void 0),i(!0);let r=await $([]);return await u({user:r})}catch(r){s(r)}finally{i(!1),l(null)}},loading:E,children:"Remove"})}),e.jsx(j,{})]})}return D.length!==0||N||V||q?h==="sms"?null:h==="totp"&&g?e.jsx(_,{onClose:n,onReset:d,submitEnrollmentWithTotp:t=>(async function(r){try{s(void 0),i(!0);let p=await I(r);return await u({user:p})}catch(p){s(p)}finally{i(!1),l(null)}})(t.mfaCode),error:y,totpInfo:{...g,appName:(a==null?void 0:a.name)||"Privy"}}):h==="passkey"?e.jsx(ee,{onReset:d,onClose:n,submitEnrollmentWithPasskey:U}):e.jsx(te,{showIntro:!0,userMfaMethods:o.mfaMethods,appMfaMethods:a.mfa.methods,userHasAuthSms:z,backFn:w,handleSelectMethod:async function(t){s(void 0);try{await T()}catch(r){return void s(r)}return t==="totp"?(f(t),k(null),void H().then((({totpSecret:r,totpAuthUrl:p})=>{k({authUrl:p,secret:r})})).catch((()=>{k(null),d()}))):t==="passkey"&&B.length===1?await U():void f(t)},isTotpLoading:h==="totp"&&!g,isPasskeyLoading:W,error:y,onClose:n,setRemovingMfaMethod:async function(t){s(void 0);try{await T()}catch(r){return void s(r)}l(t)}}):e.jsxs(e.Fragment,{children:[e.jsx(x,{onClose:n,backFn:w},"header"),e.jsx(b,{style:{marginBottom:"1.5rem"},children:e.jsx(G,{})}),e.jsx(C,{children:"Add more security"}),e.jsxs(R,{children:[a==null?void 0:a.name," does not have any verification methods enabled."]}),e.jsx(S,{children:e.jsx(F,{onClick:n,children:"Close"})}),e.jsx(j,{})]})}};export{We as MfaAuthEnrollmentFlowScreen,We 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.