PageSourceSearch

https://goexpired.com/assets/ResetPassword-BLbhQrtJ.js

js goexpired.com collected 2026-10-09 22:42:20 UTC 3,868 bytes, 1 lines download raw bytes

1import{c as v,b as N,r,s as i,j as e,G as C,y as S,h as E}from"./index-DocTL6Xp.js";const s={bg:"#FAF9F5",surface:"#FFFFFF",ink:"#1A1A1A",inkMuted:"#6B6B68",border:"#E8E5DD",accent:"#2563EB",accentHover:"#1D4FD8"},P="'Inter', system-ui, -apple-system, sans-serif";function A(){const u=v(),{toast:o}=N(),[b,c]=r.useState(!0),[y,m]=r.useState(!1),[x,F]=r.useState(null),[n,w]=r.useState(""),[p,g]=r.useState(""),[h,f]=r.useState(!1);r.useEffect(()=>{document.title="Reset password - GoExpired.com";let t=!1;const{data:{subscription:a}}=i.auth.onAuthStateChange((l,d)=>{t||l==="PASSWORD_RECOVERY"&&d&&(m(!0),c(!1))});return(async()=>{for(let l=0;l<12;l++){const{data:d}=await i.auth.getSession();if(t)return;if(d.session){m(!0),c(!1);return}await new Promise(k=>setTimeout(k,150))}t||(c(!1),F("This password reset link is invalid or has expired. Please request a new one."))})(),()=>{t=!0,a.unsubscribe()}},[]);const j=async t=>{if(t.preventDefault(),n.length<8){o({title:"Password too short",description:"Use at least 8 characters.",variant:"destructive"});return}if(n!==p){o({title:"Passwords do not match",description:"Please retype the same password.",variant:"destructive"});return}f(!0);try{const{error:a}=await i.auth.updateUser({password:n});if(a)throw a;await i.auth.signOut(),o({title:"Password updated",description:"Please sign in with your new password."}),u("/auth",{replace:!0})}catch(a){o({title:"Could not update password",description:(a==null?void 0:a.message)??"Try again.",variant:"destructive"})}finally{f(!1)}};return e.jsxs("div",{className:"min-h-screen flex flex-col",style:{backgroundColor:s.bg,color:s.ink,fontFamily:P},children:[e.jsx(C,{}),e.jsx("main",{className:"flex-1 flex items-center justify-center px-4 py-12",children:e.jsx("div",{className:"w-full max-w-md",children:e.jsxs("div",{className:"rounded-3xl p-8 md:p-10",style:{backgroundColor:s.surface,border:`1px solid ${s.border}`,boxShadow:"0 1px 2px rgba(26,26,26,0.04), 0 8px 32px -16px rgba(26,26,26,0.08)"},children:[e.jsx("h1",{className:"text-2xl md:text-3xl tracking-tight mb-3 text-center",style:{fontFamily:"'Cormorant', serif",fontWeight:600},children:"Reset your password"}),b?e.jsxs("div",{className:"flex flex-col items-center py-8",children:[e.jsx(S,{className:"w-6 h-6 animate-spin",style:{color:s.accent}}),e.jsx("p",{className:"text-sm mt-3",style:{color:s.inkMuted},children:"Verifying your reset link..."})]}):x?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm mb-6 text-center",style:{color:s.inkMuted},children:x}),e.jsx("button",{onClick:()=>u("/auth"),className:"w-full h-11 rounded-full text-sm font-medium",style:{backgroundColor:s.accent,color:"#FFFFFF"},children:"Back to sign in"})]}):y?e.jsxs("form",{onSubmit:j,className:"space-y-4",children:[e.jsx("p",{className:"text-sm mb-2 text-center",style:{color:s.inkMuted},children:"Enter a new password for your account."}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs mb-1",style:{color:s.inkMuted},children:"New password"}),e.jsx("input",{type:"password",value:n,onChange:t=>w(t.target.value),minLength:8,required:!0,autoFocus:!0,className:"w-full h-11 px-4 rounded-xl text-sm outline-none",style:{border:`1px solid ${s.border}`,backgroundColor:"#FFFFFF"}})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs mb-1",style:{color:s.inkMuted},children:"Confirm new password"}),e.jsx("input",{type:"password",value:p,onChange:t=>g(t.target.value),minLength:8,required:!0,className:"w-full h-11 px-4 rounded-xl text-sm outline-none",style:{border:`1px solid ${s.border}`,backgroundColor:"#FFFFFF"}})]}),e.jsx("button",{type:"submit",disabled:h,className:"w-full h-11 rounded-full text-sm font-medium disabled:opacity-60",style:{backgroundColor:s.accent,color:"#FFFFFF"},children:h?"Updating...":"Update password"})]}):null]})})}),e.jsx(E,{})]})}export{A 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.