PageSourceSearch

https://travelcommunity.lovable.app/assets/reset-password-CmDwgrFz.js

js travelcommunity.lovable.app collected 2026-10-03 03:51:25 UTC 2,216 bytes, 1 lines download raw bytes

1import{u as b,r as t,j as s,L as x,t as o,s as u}from"./index-ClQcrGAC.js";function w(){const e=b(),[d,p]=t.useState(""),[l,m]=t.useState(""),[i,n]=t.useState(!1),[c,f]=t.useState(!1);t.useEffect(()=>{document.title=e("reset.page_title","Reset password")},[e]),t.useEffect(()=>{typeof window<"u"&&window.location.hash.includes("type=recovery")&&f(!0)},[]);const g=async r=>{r.preventDefault(),n(!0);const{error:a}=await u.auth.resetPasswordForEmail(d,{redirectTo:`${window.location.origin}/reset-password`});n(!1),a?o.error(a.message):o.success(e("reset.success"))},h=async r=>{if(r.preventDefault(),l.length<8){o.error(e("reset.min_chars"));return}n(!0);const{error:a}=await u.auth.updateUser({password:l});n(!1),a?o.error(a.message):o.success(e("reset.updated"))};return s.jsx("div",{className:"min-h-screen bg-background text-foreground flex items-center justify-center px-4 py-16",children:s.jsxs("div",{className:"w-full max-w-md space-y-8",children:[s.jsx("h1",{className:"font-display text-3xl font-semibold text-center",children:e(c?"reset.recovery_title":"reset.forgot_title")}),c?s.jsxs("form",{onSubmit:h,className:"space-y-4",children:[s.jsx("input",{type:"password",value:l,onChange:r=>m(r.target.value),placeholder:e("reset.new_password"),required:!0,minLength:8,className:"w-full px-4 py-3 rounded-lg bg-card border border-border focus:border-primary outline-none"}),s.jsx("button",{disabled:i,className:"w-full bg-primary text-primary-foreground font-semibold py-3 rounded-full hover:brightness-110 disabled:opacity-50",children:e("reset.save_password")})]}):s.jsxs("form",{onSubmit:g,className:"space-y-4",children:[s.jsx("input",{type:"email",value:d,onChange:r=>p(r.target.value),placeholder:e("auth.email"),required:!0,className:"w-full px-4 py-3 rounded-lg bg-card border border-border focus:border-primary outline-none"}),s.jsx("button",{disabled:i,className:"w-full bg-primary text-primary-foreground font-semibold py-3 rounded-full hover:brightness-110 disabled:opacity-50",children:e("reset.cta")})]}),s.jsx("div",{className:"text-center text-sm",children:s.jsx(x,{to:"/login",className:"text-muted-foreground hover:underline",children:e("reset.back_login")})})]})})}export{w 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.