PageSourceSearch

https://landledger.co/assets/BorrowerVerificationHandoff-B7Wa4usA.js

js landledger.co collected 2026-10-04 06:55:15 UTC 17,167 bytes, 6 lines download raw bytes

1var ae=Object.defineProperty;var ie=(s,n,i)=>n in s?ae(s,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[n]=i;var Y=(s,n,i)=>ie(s,typeof n!="symbol"?n+"":n,i);import{f as ne,u as re,c as oe,r as h,d as H,j as e,B as x,q as S,R as L,L as j,a as k,b as K}from"./index-CudHG6B4.js";import{u as E}from"./useMutation-CBAYgnG2.js";import{C as d,a as m}from"./card-5b9UOcPu.js";import{C as T}from"./clock-3-D4RumAKQ.js";import{T as $}from"./triangle-alert-BA2tGhup.js";import{M as P}from"./mail-CILgT88w.js";import{C as R}from"./check-D8BjNWtW.js";import{A}from"./arrow-right-B1UlrPw0.js";import{S as O}from"./shield-check-ic92rXB7.js";/**
2 * @license lucide-react v0.469.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const ce=ne("FileCheck2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m3 15 2 2 4-4",key:"1lhrkk"}]]);function le(s){if(s.authTimedOut)return"auth_timeout";const n=s.isAuthenticated&&s.resolvedLoading;if(s.authLoading||s.publicLoading||n)return"loading";const i=s.resolvedErrorCode==="WRONG_ACCOUNT",r=s.resolvedErrorCode==="EMAIL_VERIFICATION_REQUIRED";return s.publicError||s.resolvedError&&!i&&!r?"load_failed":s.publicStatus==="invalid"?"invalid":!s.isAuthenticated&&s.publicStatus==="expired"?"expired_signed_out":s.isAuthenticated&&i?"wrong_account":s.isAuthenticated&&r?"email_verification_required":s.isAuthenticated&&s.resolvedStatus==="expired"?"expired_signed_in":s.isAuthenticated?s.resolvedStatus==="ready"&&s.hasVerificationPath?"redirect":s.resolvedStatus==="completed"?"completed":"load_failed":"sign_in"}class N extends Error{constructor(i,r){super(i);Y(this,"code");this.code=r}}const B=async s=>{const n=new AbortController,i=window.setTimeout(()=>n.abort(),1e4);try{const r=await fetch(s,{credentials:"include",signal:n.signal}),c=await r.json().catch(()=>({}));if(!r.ok)throw new N((c==null?void 0:c.message)||"We could not load this link.",c==null?void 0:c.code);return c}catch(r){throw r instanceof N?r:r instanceof DOMException&&r.name==="AbortError"?new N("The secure handoff took too long to load. Please try again.","HANDOFF_TIMEOUT"):new N("We could not load this link. Please try again.","HANDOFF_NETWORK_ERROR")}finally{window.clearTimeout(i)}};function we({token:s}){var U;const[,n]=re(),{user:i,isAuthenticated:r,isLoading:c}=oe(),[G,q]=h.useState(!1),[Q,D]=h.useState(!1),[I,F]=h.useState(null),[J,z]=h.useState(!1),[y,V]=h.useState(null),W=h.useMemo(()=>`/borrower/verify/${encodeURIComponent(s||"")}`,[s]),M=encodeURIComponent(W),p=`/login?returnTo=${M}`,X=`/signup?returnTo=${M}`,v=H({queryKey:["/api/borrower-verification-intents",s],queryFn:()=>B(`/api/borrower-verification-intents/${encodeURIComponent(s||"")}`),enabled:!!s,retry:!1}),u=H({queryKey:["/api/borrower-verification-intents",s,"resolve"],queryFn:()=>B(`/api/borrower-verification-intents/${encodeURIComponent(s||"")}/resolve`),enabled:!!s&&r,retry:!1}),C=E({mutationFn:async a=>(await K("POST",`/api/v2/loan-applications/${encodeURIComponent(String(a))}/request-borrower-verification`)).json(),onMutate:()=>F(null),onSuccess:()=>D(!0),onError:a=>F(a.message||"We could not send a new email. Please try again.")}),b=E({mutationFn:()=>K("POST","/api/auth/logout"),onMutate:()=>V(null),onSuccess:async()=>{await S.invalidateQueries({queryKey:["/api/auth/user"]}),n(p)},onError:a=>{V(a.message||"We could not sign out. Please refresh and try again.")}}),w=E({mutationFn:async()=>{if(!(i!=null&&i.email))throw new Error("Your account email could not be loaded. Please sign in again.");const a=await fetch("/api/auth/resend-verification",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({email:i.email,signupReturnTo:W})}),g=await a.json().catch(()=>({}));if(!a.ok)throw new Error((g==null?void 0:g.message)||"We could not send the verification email.");return g},onSuccess:()=>z(!0)}),Z=a=>{a&&n(a)};h.useEffect(()=>{if(!c){q(!1);return}const a=window.setTimeout(()=>q(!0),1e4);return()=>window.clearTimeout(a)},[c]);const ee=(U=v.data)==null?void 0:U.status,t=u.data,se=u.error instanceof N?u.error.code:void 0,o=le({authLoading:c,authTimedOut:G,isAuthenticated:r,publicLoading:v.isLoading,publicError:v.isError,publicStatus:ee,resolvedLoading:u.isLoading,resolvedError:u.isError,resolvedErrorCode:se,resolvedStatus:t==null?void 0:t.status,hasVerificationPath:!!(t!=null&&t.verificationPath)});h.useEffect(()=>{r&&(t==null?void 0:t.status)==="ready"&&t.verificationPath&&n(t.verificationPath)},[r,n,t==null?void 0:t.status,t==null?void 0:t.verificationPath]);const te=()=>e.jsxs("header",{className:"mb-8 flex items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-xl bg-[#0f5b55] text-[#f6f1e7] shadow-sm",children:e.jsx(ce,{className:"h-5 w-5",strokeWidth:1.8})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-[var(--font-display)] text-[17px] font-semibold tracking-[-0.02em] text-[#173b3a]",children:"Land Ledger"}),e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-[0.16em] text-[#718482]",children:"Borrower services"})]})]}),f=()=>e.jsxs("div",{className:"mt-8 flex gap-3 border-t border-[#d8e1db] pt-5 text-xs leading-5 text-[#61706d]",children:[e.jsx(O,{className:"mt-0.5 h-4 w-4 shrink-0 text-[#0f766e]"}),e.jsx("p",{children:"Your identity details are entered only on Land Ledger. We will never ask for them by email or phone."})]}),l=({children:a})=>e.jsx("main",{className:"min-h-[100dvh] bg-[#edf2ed] px-5 py-8 text-[#173b3a] sm:px-8 sm:py-14",children:e.jsxs("div",{className:"mx-auto w-full max-w-[520px]",children:[e.jsx(te,{}),a,e.jsx("p",{className:"mt-7 text-center text-xs text-[#7a8985]",children:"A secure handoff from your Land Ledger loan team"})]})});if(o==="loading"||o==="redirect")return e.jsx(l,{children:e.jsx(d,{className:"border-[#d8e1db] bg-[#f8faf6] shadow-[0_18px_50px_rgba(28,66,57,0.08)]",children:e.jsxs(m,{className:"p-8 sm:p-10",children:[e.jsxs("div",{className:"animate-pulse space-y-5",children:[e.jsx("div",{className:"h-3 w-24 rounded bg-[#dce6df]"}),e.jsx("div",{className:"h-9 w-4/5 rounded bg-[#dce6df]"}),e.jsx("div",{className:"h-4 w-full rounded bg-[#e4ebe5]"}),e.jsx("div",{className:"h-12 w-full rounded-lg bg-[#dce6df]"})]}),e.jsx("p",{className:"mt-6 text-sm text-[#718482]",children:"Checking your secure handoff…"})]})})});if(o==="auth_timeout")return e.jsx(l,{children:e.jsx(d,{className:"border-[#e3d8c8] bg-[#fbfaf5] shadow-[0_18px_50px_rgba(28,66,57,0.08)]",children:e.jsxs(m,{className:"p-8 sm:p-10",children:[e.jsx("div",{className:"mb-6 flex h-12 w-12 items-center justify-center rounded-full bg-[#f3e8d9] text-[#966b39]",children:e.jsx(T,{className:"h-6 w-6"})}),e.jsx("h1",{className:"font-[var(--font-display)] text-3xl font-semibold tracking-[-0.035em]",children:"Sign-in check is taking too long"}),e.jsx("p",{className:"mt-3 text-[15px] leading-6 text-[#61706d]",children:"Your secure link is still available, but we could not confirm your sign-in. Refresh this check or c
6ontinue to sign in."}),e.jsxs("div",{className:"mt-7 flex flex-col gap-3 sm:flex-row",children:[e.jsxs(x,{onClick:()=>{S.refetchQueries({queryKey:["/api/auth/user"]})},className:"h-11 bg-[#0f5b55] text-[#f8faf6] hover:bg-[#0b4a45]",children:[e.jsx(L,{className:"mr-2 h-4 w-4"})," Check again"]}),e.jsx(j,{href:p,className:"inline-flex h-11 items-center justify-center rounded-md border border-[#c7d4ca] px-4 text-sm font-medium text-[#28524e] hover:bg-[#eef4ee]",children:"Go to sign in"})]}),e.jsx(f,{})]})})});if(o==="load_failed")return e.jsx(l,{children:e.jsx(d,{className:"border-[#e3d8c8] bg-[#fbfaf5] shadow-[0_18px_50px_rgba(28,66,57,0.08)]",children:e.jsxs(m,{className:"p-8 sm:p-10",children:[e.jsx("div",{className:"mb-6 flex h-12 w-12 items-center justify-center rounded-full bg-[#f3e8d9] text-[#966b39]",children:e.jsx($,{className:"h-6 w-6"})}),e.jsx("h1",{className:"font-[var(--font-display)] text-3xl font-semibold tracking-[-0.035em]",children:"We could not open this handoff"}),e.jsx("p",{className:"mt-3 text-[15px] leading-6 text-[#61706d]",children:"The link may be temporarily unavailable. Please try again, or sign in to Land Ledger and open the latest message from your loan team."}),e.jsxs("div",{className:"mt-7 flex flex-col gap-3 sm:flex-row",children:[e.jsxs(x,{onClick:()=>{v.refetch(),u.refetch()},className:"h-11 bg-[#0f5b55] text-[#f8faf6] hover:bg-[#0b4a45]",children:[e.jsx(L,{className:"mr-2 h-4 w-4"})," Try again"]}),e.jsx(j,{href:p,className:"inline-flex h-11 items-center justify-center rounded-md border border-[#c7d4ca] px-4 text-sm font-medium text-[#28524e] hover:bg-[#eef4ee]",children:"Go to sign in"})]}),e.jsx(f,{})]})})});if(o==="email_verification_required")return e.jsx(l,{children:e.jsx(d,{className:"border-[#d8e1db] bg-[#f8faf6] shadow-[0_18px_50px_rgba(28,66,57,0.08)]",children:e.jsxs(m,{className:"p-8 sm:p-10",children:[e.jsx("div",{className:"mb-6 flex h-12 w-12 items-center justify-center rounded-full bg-[#dcece4] text-[#0f766e]",children:e.jsx(P,{className:"h-6 w-6"})}),e.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-[#0f766e]",children:"One security step remains"}),e.jsx("h1",{className:"mt-3 font-[var(--font-display)] text-3xl font-semibold tracking-[-0.035em]",children:"Verify your email to continue"}),e.jsx("p",{className:"mt-3 text-[15px] leading-6 text-[#61706d]",children:"We need to confirm your Land Ledger email before collecting identity details. The email link will preserve this secure loan handoff."}),e.jsxs("div",{className:"mt-7 space-y-3",children:[J?e.jsxs("div",{className:"rounded-lg border border-[#bad6c4] bg-[#edf7ef] p-4 text-sm leading-5 text-[#28624c]",role:"status",children:[e.jsx(R,{className:"mr-2 inline h-4 w-4"}),"Verification email sent. Open it, verify your email, then sign in to continue here."]}):e.jsxs(x,{onClick:()=>w.mutate(),disabled:w.isPending||!(i!=null&&i.email),className:"h-11 w-full bg-[#0f5b55] text-[#f8faf6] hover:bg-[#0b4a45]",children:[w.isPending?e.jsx(k,{className:"mr-2 h-4 w-4 animate-spin"}):e.jsx(P,{className:"mr-2 h-4 w-4"}),"Send verification email"]}),w.isError&&e.jsx("p",{role:"alert",className:"text-sm leading-5 text-red-700",children:w.error.message}),e.jsxs(x,{variant:"outline",onClick:async()=>{await S.refetchQueries({queryKey:["/api/auth/user"]}),await u.refetch()},className:"h-11 w-full",children:[e.jsx(L,{className:"mr-2 h-4 w-4"}),"I’ve verified my email — check again"]}),e.jsxs(x,{variant:"outline",onClick:()=>b.mutate(),disabled:b.isPending,className:"h-11 w-full",children:[b.isPending?e.jsx(k,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Use a different account"]}),y&&e.jsx("p",{role:"alert",className:"text-sm leading-5 text-red-700",children:y})]}),e.jsx(f,{})]})})});if(o==="invalid")return e.jsx(l,{children:e.jsx(d,{className:"border-[#d8e1db] bg-[#f8faf6] shadow-[0_18px_50px_rgba(28,66,57,0.08)]",children:e.jsxs(m,{className:"p-8 sm:p-10",children:[e.jsx("div",{className:"mb-6 flex h-12 w-12 items-center justify-center rounded-full bg-[#e8efea] text-[#61706d]",children:e.jsx($,{className:"h-6 w-6"})}),e.jsx("h1",{className:"font-[var(--font-display)] text-3xl font-semibold tracking-[-0.035em]",children:"This link is not available"}),e.jsx("p",{className:"mt-3 text-[15px] leading-6 text-[#61706d]",children:"This verification link is invali
6d or no longer active. Please contact your loan team for a new email."}),e.jsx(j,{href:p,className:"mt-7 inline-flex h-11 w-full items-center justify-center rounded-md bg-[#0f5b55] text-sm font-semibold text-[#f8faf6] hover:bg-[#0b4a45]",children:"Go to sign in"}),e.jsx(f,{})]})})});if(o==="expired_signed_out")return e.jsx(l,{children:e.jsx(d,{className:"border-[#e3d8c8] bg-[#fbfaf5] shadow-[0_18px_50px_rgba(28,66,57,0.08)]",children:e.jsxs(m,{className:"p-8 sm:p-10",children:[e.jsx("div",{className:"mb-6 flex h-12 w-12 items-center justify-center rounded-full bg-[#f3e8d9] text-[#966b39]",children:e.jsx(T,{className:"h-6 w-6"})}),e.jsx("h1",{className:"font-[var(--font-display)] text-3xl font-semibold tracking-[-0.035em]",children:"This link has expired"}),e.jsx("p",{className:"mt-3 text-[15px] leading-6 text-[#61706d]",children:"For your security, this verification link is no longer active. Sign in to Land Ledger and contact your loan team for a fresh link."}),e.jsxs(j,{href:p,className:"mt-7 inline-flex h-11 w-full items-center justify-center rounded-md bg-[#0f5b55] text-sm font-semibold text-[#f8faf6] hover:bg-[#0b4a45]",children:["Go to sign in ",e.jsx(A,{className:"ml-2 h-4 w-4"})]}),e.jsx(f,{})]})})});if(o==="wrong_account"||o==="expired_signed_in"){const a=o==="wrong_account",g=!!(t!=null&&t.applicationId)&&o==="expired_signed_in";return e.jsx(l,{children:e.jsx(d,{className:"border-[#d8e1db] bg-[#f8faf6] shadow-[0_18px_50px_rgba(28,66,57,0.08)]",children:e.jsxs(m,{className:"p-8 sm:p-10",children:[e.jsx("div",{className:"mb-6 flex h-12 w-12 items-center justify-center rounded-full bg-[#f3e8d9] text-[#966b39]",children:a?e.jsx(O,{className:"h-6 w-6"}):e.jsx(T,{className:"h-6 w-6"})}),e.jsx("h1",{className:"font-[var(--font-display)] text-3xl font-semibold tracking-[-0.035em]",children:a?"Use the right Land Ledger account":"This link has expired"}),e.jsx("p",{className:"mt-3 text-[15px] leading-6 text-[#61706d]",children:a?"This link belongs to another Land Ledger account. Switch accounts to continue securely.":"For your security, verification links are time-limited. You can request a fresh link below."}),e.jsxs("div",{className:"mt-7 space-y-3",children:[a&&e.jsxs(x,{onClick:()=>b.mutate(),disabled:b.isPending,className:"h-11 w-full bg-[#0f5b55] text-[#f8faf6] hover:bg-[#0b4a45]",children:[b.isPending?e.jsx(k,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Switch account"]}),g&&(Q?e.jsxs("div",{className:"rounded-lg border border-[#bad6c4] bg-[#edf7ef] p-4 text-sm leading-5 text-[#28624c]",children:[e.jsx(R,{className:"mr-2 inline h-4 w-4"}),"A new verification email has been requested. Check your inbox."]}):e.jsxs(x,{onClick:()=>C.mutate(t.applicationId),disabled:C.isPending,variant:a?"outline":"default",className:"h-11 w-full",children:[C.isPending?e.jsx(k,{className:"mr-2 h-4 w-4 animate-spin"}):e.jsx(P,{className:"mr-2 h-4 w-4"}),"Send a new verification email"]})),I&&e.jsx("p",{role:"alert",className:"text-sm leading-5 text-red-700",children:I}),y&&e.jsx("p",{role:"alert",className:"text-sm leading-5 text-red-700",children:y})]}),e.jsx(f,{})]})})})}if(o==="sign_in")return e.jsx(l,{children:e.jsx(d,{className:"border-[#d8e1db] bg-[#f8faf6] shadow-[0_18px_50px_rgba(28,66,57,0.08)]",children:e.jsxs(m,{className:"p-8 sm:p-10",children:[e.jsx("div",{className:"mb-6 flex h-12 w-12 items-center justify-center rounded-full bg-[#dcece4] text-[#0f766e]",children:e.jsx(O,{className:"h-6 w-6"})}),e.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-[#0f766e]",children:"Secure identity check"}),e.jsx("h1",{className:"mt-3 font-[var(--font-display)] text-3xl font-semibold tracking-[-0.035em]",children:"Let’s finish this together"}),e.jsx("p",{className:"mt-3 text-[15px] leading-6 text-[#61706d]",children:"Sign in to Land Ledger to continue your identity verification. We’ll bring you right back to this secure handoff."}),e.jsxs("div",{className:"mt-7 grid gap-3 sm:grid-cols-2",children:[e.jsxs(j,{href:p,className:"inline-flex h-11 items-center justify-center rounded-md bg-[#0f5b55] text-sm font-semibold text-[#f8faf6] hover:bg-[#0b4a45]",children:["Sign in ",e.jsx(A,{className:"ml-2 h-4 w-4"})]}),e.jsx(j,{href:X,className:"inline-flex h-11 items-center justify-center rounded-md border border-[#c7d4ca] text-sm font-semibold text-[#28524e] hover:bg-[#eef4ee]",children:"Create an account"})]}),e.jsx(f,{})]})})});const _=(t==null?void 0:t.status)==="completed";return e.jsx(l,{children:e.jsx(d,{className:"border-[#c8ddd0] bg-[#f8faf6] shadow-[0_18px_50px_rgba(28,66,57,0.08)]",children:e.jsxs(m,{className:"p-8 sm:p-10",children:[e.jsx("div",{className:"mb-6 flex h-12 w-12 items-center justify-center rounded-full bg-[#dcece4] text-[#0f766e]",children:e.jsx(R,{className:"h-6 w-6",strokeWidth:2.5})}),e.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-[#0f766e]",children:"You’re signed in"}),e.jsx("h1",{className:"mt-3 font-[var(--font-display)] text-3xl font-semibold tracking-[-0.035em]",children:_?"Your identity check is complete":"Ready when you are"}),e.jsx("p",{className:"mt-3 text-[15px] leading-6 text-[#61706d]",children:_?"Continue to your application to review what comes next.":"Continue to Land Ledger’s secure verification flow. Your loan team will be notified when it’s complete."}),e.jsxs(x,{onClick:()=>Z(_?t==null?void 0:t.applicationPath:t==null?void 0:t.verificationPath),className:"mt-7 h-11 w-full bg-[#0f5b55] text-[#f8faf6] hover:bg-[#0b4a45]",children:[_?"View my application":"Continue to verification",e.jsx(A,{className:"ml-2 h-4 w-4"})]}),e.jsx(f,{})]})})})}export{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.