PageSourceSearch

https://littlewildmobilefarm.com/assets/reset-password-CH_jTf0z.js

js littlewildmobilefarm.com collected 2026-10-09 22:03:44 UTC 2,443 bytes, 1 lines download raw bytes

1import{u as g,r as a,s as n,j as e,S as f,L as w,t as o}from"./index-D2G60a0R.js";function y(){const l=g(),[r,m]=a.useState(""),[i,p]=a.useState(""),[d,u]=a.useState(!1),[x,c]=a.useState(!1);a.useEffect(()=>{const{data:{subscription:t}}=n.auth.onAuthStateChange(s=>{(s==="PASSWORD_RECOVERY"||s==="SIGNED_IN")&&c(!0)});return n.auth.getSession().then(({data:s})=>{s.session&&c(!0)}),()=>t.unsubscribe()},[]);const h=async t=>{if(t.preventDefault(),r!==i){o.error("Passwords do not match");return}if(r.length<8){o.error("Password must be at least 8 characters");return}u(!0);try{const{error:s}=await n.auth.updateUser({password:r});if(s)throw s;o.success("Password updated. Signing you in…"),l({to:"/admin"})}catch(s){o.error(s instanceof Error?s.message:"Failed to update password")}finally{u(!1)}};return e.jsx(f,{children:e.jsx("section",{className:"container-page py-20",children:e.jsxs("div",{className:"mx-auto max-w-md rounded-3xl border border-tan/40 bg-card p-8 shadow-soft",children:[e.jsx("h1",{className:"font-display text-3xl text-wood",children:"Set new password"}),e.jsx("p",{className:"mt-1 text-sm text-wood/60",children:"Choose a strong password (at least 8 characters)."}),x?e.jsxs("form",{onSubmit:h,className:"mt-6 space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs uppercase tracking-wider text-wood/70",children:"New password"}),e.jsx("input",{type:"password",required:!0,minLength:8,value:r,onChange:t=>m(t.target.value),className:"mt-1 w-full rounded-xl border border-tan/50 bg-cream px-4 py-3 text-sm focus:outline-none focus:ring-2 focus:ring-sage"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs uppercase tracking-wider text-wood/70",children:"Confirm password"}),e.jsx("input",{type:"password",required:!0,minLength:8,value:i,onChange:t=>p(t.target.value),className:"mt-1 w-full rounded-xl border border-tan/50 bg-cream px-4 py-3 text-sm focus:outline-none focus:ring-2 focus:ring-sage"})]}),e.jsx("button",{type:"submit",disabled:d,className:"w-full rounded-full bg-sage-deep px-6 py-3 text-sm font-medium text-cream hover:bg-wood transition disabled:opacity-60",children:d?"Saving…":"Update password"})]}):e.jsxs("p",{className:"mt-6 text-sm text-wood/60",children:["Verifying reset link… If this hangs, request a new link from"," ",e.jsx(w,{to:"/auth",className:"text-sage-deep hover:underline",children:"the sign-in page"}),"."]})]})})})}export{y as component};

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.