PageSourceSearch

https://textpro.ai/assets/VerifyEmailPage-ksd269yE.js

js textpro.ai collected 2026-10-05 12:46:18 UTC 4,788 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-mui-CoUUu5rl.js";import{d as j,i as w,u as b,a as l}from"./vendor-react-BNAzxHWw.js";import{u as k,M as N,S as V,L as E,C as S,a2 as A,A as z,R as C,d as P}from"./index-BK3bKK-b.js";import{a as u}from"./vendor-motion-cBYmFaLh.js";import"./vendor-web3-CnYzRP7Q.js";const Y=()=>{const[p]=j(),{token:g}=w(),i=p.get("token")||g,m=b(),{login:y,checkAuth:c,isAuthenticated:a,user:t}=k(),[s,n]=l.useState("loading"),[h,o]=l.useState(""),f=l.useRef(!1);return l.useEffect(()=>{if(!i){console.error("[VerifyEmail] No token provided in URL."),n("error"),o("No verification token provided. Please check the link in your email.");return}if(f.current){console.log("[VerifyEmail] Verification already in progress or completed. Skipping.");return}console.log("[VerifyEmail] Verification page loaded. Token found:",!!i);let d=!1;const v=setTimeout(async()=>{try{f.current=!0,console.log("[VerifyEmail] Initiating API call for token:",i.substring(0,8)+"...");const r=await P.verifyEmail(i);if(d)return;console.log("[VerifyEmail] API call successful. Auto-logging in..."),r.token&&r.user?y(r.token,r.user):await c(),n("success"),o("Your email has been successfully verified!")}catch(r){if(d)return;console.error("[VerifyEmail] Verification failed:",r);const x=r.message||"";if(x.toLowerCase().includes("already verified")||x.toLowerCase().includes("already active")||a&&t?.isVerified){console.log("[VerifyEmail] User was already verified. Guided to success."),a||await c(),n("success"),o("Your email is already verified!");return}n("error"),o(r.message||"Failed to verify email. The link may have expired or is invalid.")}},500);return()=>{d=!0,clearTimeout(v)}},[i,c,a,t?.isVerified]),e.jsxs(N,{children:[e.jsx(V,{title:"Verify Email | Textpro AI",description:"Verify your email address to activate your account."}),e.jsxs("div",{className:"min-h-[calc(100dvh-64px)] lg:min-h-[calc(100dvh-80px)] flex items-center justify-center p-4 relative overflow-hidden",children:[e.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[600px] h-[600px] bg-primary/5 rounded-full blur-[120px] -z-10"}),e.jsxs(u.div,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},className:"w-full max-w-md glass-card !rounded-[3rem] border border-[var(--border-strong)] p-8 sm:p-12 text-center space-y-10 shadow-premium relative z-10",children:[e.jsxs("div",{className:"flex justify-center",children:[s==="loading"&&e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-24 h-24 rounded-[2rem] bg-primary/5 flex items-center justify-center relative z-10",children:e.jsx(E,{size:48,className:"text-primary animate-spin"})}),e.jsx(u.div,{animate:{scale:[1,1.2,1],opacity:[.1,.2,.1]},transition:{duration:2,repeat:1/0},className:"absolute inset-0 bg-primary rounded-full blur-2xl"})]}),s==="success"&&e.jsx("div",{className:"w-24 h-24 rounded-[2rem] bg-green-500/10 flex items-center justify-center text-green-500 shadow-lg shadow-green-500/10 border border-green-500/20",children:e.jsx(S,{size:48})}),s==="error"&&e.jsx("div",{className:"w-24 h-24 rounded-[2rem] bg-red-500/10 flex items-center justify-center text-red-500 shadow-lg shadow-red-500/10 border border-red-500/20",children:e.jsx(A,{size:48})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("h1",{className:"text-4xl font-black text-[var(--text-primary)] italic tracking-tight",children:[s==="loading"&&"Securing...",s==="success"&&"Success!",s==="error"&&"Issue Detected"]}),e.jsx("p",{className:"text-[var(--text-secondary)] font-medium leading-relaxed px-4",children:h||"Please wait while we verify your secure connection."})]}),s!=="loading"&&e.jsxs(u.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.2},children:[e.jsxs("button",{onClick:()=>{s==="success"||a&&t?.isVerified?window.location.href="/signup?step=3":m("/signup?mode=signin&verified=true")},className:"premium-btn w-full h-16 text-sm uppercase tracking-widest !rounded-2xl group flex items-center justify-center gap-3 relative overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 bg-white/10 translate-y-full group-hover:translate-y-0 transition-transform duration-300"}),e.jsx("span",{className:"relative z-10",children:s==="success"||a&&t?.isVerified?"Next: Secure Account":"Return to Sign In"}),e.jsx(z,{size:20,className:"relative z-10 group-hover:translate-x-1 transition-transform"})]}),s==="error"&&e.jsxs("button",{onClick:()=>m("/signup?mode=signin"),className:"mt-6 text-xs font-black uppercase tracking-widest text-[var(--text-muted)] hover:text-primary transition-colors flex items-center justify-center gap-2 mx-auto",children:[e.jsx(C,{size:14}
1),e.jsx("span",{children:"Resend Verification Email"})]})]})]})]})]})};export{Y as VerifyEmailPage,Y 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.