1import{w,r as a,s as l,j as e,h as b,B as g,n as o}from"./index-DuBrVlzG.js";import{I as u}from"./input-BLjwDyPb.js";import{L as m}from"./label-CKd6vdRR.js";const v=()=>{const p=w(),[d,n]=a.useState(!1),[f,c]=a.useState(!1);a.useEffect(()=>{const{data:{subscription:s}}=l.auth.onAuthStateChange(r=>{r==="PASSWORD_RECOVERY"&&c(!0)});return window.location.hash.includes("type=recovery")&&c(!0),()=>s.unsubscribe()},[]);const h=async s=>{s.preventDefault();const t=new FormData(s.currentTarget),r=t.get("password"),x=t.get("confirm");if(r!==x){o.error("Passwords do not match.");return}n(!0);const{error:i}=await l.auth.updateUser({password:r});n(!1),i?o.error(i.message):(o.success("Password updated successfully!"),p("/directory/dashboard",{replace:!0}))};return e.jsxs("div",{className:"relative flex-1 flex items-center justify-center bg-background px-4 py-12 overflow-hidden",children:[e.jsx(b,{title:"Reset Password",description:"Set a new password for your WGOAA account."}),e.jsx("div",{className:"absolute inset-0 patriotic-stars"}
1),e.jsxs("div",{className:"relative w-full max-w-md space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"text-4xl md:text-5xl mb-2",children:"Reset Password"}),e.jsx("h2",{className:"font-body text-muted-foreground text-lg",children:"Enter your new password below"})]}),e.jsx("div",{className:"bg-card border border-border rounded-lg p-6",children:f?e.jsxs("form",{onSubmit:h,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"password",className:"font-body text-foreground",children:"New Password"}),e.jsx(u,{id:"password",name:"password",type:"password",required:!0,minLength:6,placeholder:"At least 6 characters",className:"bg-muted border-border"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"confirm",className:"font-body text-foreground",children:"Confirm Password"}),e.jsx(u,{id:"confirm",name:"confirm",type:"password",required:!0,minLength:6,placeholder:"Repeat your password",className:"bg-muted border-border"})]}),e.jsx(g,{type:"submit",disabled:d,className:"w-full bg-rose-gradient text-foreground font-body uppercase tracking-wider text-xs border-0",children:d?"Updatingâ¦":"Set New Password"})]}):e.jsxs("p",{className:"text-center font-body text-muted-foreground",children:["Verifying your reset link⦠If this doesn't change, please request a new reset link from the"," ",e.jsx("a",{href:"/auth",className:"text-primary underline",children:"sign-in page"}),"."]})})]})]})};export{v as default}; 2//# sourceMappingURL=ResetPassword-CWdNu9lQ.js.map
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.