PageSourceSearch

https://furnea.ai/assets/ResetPassword-CvtwxOqk.js

js furnea.ai collected 2026-10-05 12:24:09 UTC 4,389 bytes, 1 lines download raw bytes

1import{j as e,l as s,E as t,v as r}from"./ui-vendor-Cr0jQPbr.js";import{a}from"./antd-vendor-1SrxY5Xd.js";import{u as o,s as l,H as n,T as i,g as c}from"./index-D_TDUqgc.js";import{u as d}from"./react-vendor-QV_AskjY.js";import"./supabase-mmufn7lB.js";import"./utils-vendor-DRCDPyZC.js";function u(){const u=d(),{t:m}=o(),[p,x]=a.useState(!1),[y,h]=a.useState(!1),[b,g]=a.useState(""),[v,f]=a.useState(""),[j,w]=a.useState(!1),[N,C]=a.useState(!1),[S,k]=a.useState(null);a.useEffect(()=>{const{data:e}=l.auth.onAuthStateChange((e,s)=>{("PASSWORD_RECOVERY"===e||"SIGNED_IN"===e&&s)&&(h(!0),x(!0))});return l.auth.getSession().then(({data:e})=>{e?.session&&h(!0),x(!0)}),()=>e?.subscription?.unsubscribe?.()},[]);return e.jsxs("div",{className:"min-h-screen flex items-center justify-center px-4",style:{backgroundColor:"var(--bg-primary)",color:"var(--text-primary)"},children:[e.jsxs(n,{children:[e.jsx("meta",{name:"robots",content:"noindex,follow"}),e.jsx("title",{children:m("auth.resetPassword.title")})]}),e.jsxs("div",{className:"w-full max-w-md rounded-2xl shadow-sm p-8",style:{backgroundColor:"var(--bg-secondary)",border:"1px solid var(--border-primary)"},children:[e.jsx("h1",{className:"text-2xl font-semibold mb-2",style:{color:"var(--text-primary)"},children:m("auth.resetPassword.title")}),e.jsx("p",{className:"text-sm mb-6",style:{color:"var(--text-secondary)"},children:m("auth.resetPassword.subtitle")}),!p&&e.jsx("div",{className:"flex justify-center py-10",children:e.jsx(s,{className:"w-6 h-6 animate-spin",style:{color:"var(--text-tertiary)"}})}),p&&!y&&e.jsxs("div",{className:"text-sm rounded-lg p-4",style:{color:"var(--accent-error)",backgroundColor:"var(--bg-tertiary)",border:"1px solid var(--border-primary)"},children:[m("auth.resetPassword.invalidLink"),e.jsx("button",{type:"button",onClick:()=>u("/auth",{replace:!0}),className:"mt-3 w-full rounded-lg py-2 text-sm font-medium transition-opacity hover:opacity-90",style:{backgroundColor:"var(--accent-orange-strong)",color:"var(--bg-primary)"},children:m("auth.resetPassword.backToLogin")})]}),p&&y&&e.jsxs("form",{onSubmit:async e=>{if(e.preventDefault(),b.length<8)k({type:"error",message:m("auth.errors.passwordTooShort")});else if(b===v){C(!0);try{const{error:e}=await l.auth.updateUser({password:b});if(e)throw e;k({type:"success",message:m("auth.resetPassword.success")}),await l.auth.signOut(),setTimeout(()=>u("/auth",{replace:!0}),1500)}catch(s){k({type:"error",message:c(s,{context:"auth",forceCatalog:!0})})}finally{C(!1)}}else k({type:"error",message:m("auth.errors.passwordMismatch")})},className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1.5",style:{color:"var(--text-secondary)"},children:m("auth.resetPassword.newPassword")}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:j?"text":"password",value:b,onChange:e=>g(e.target.value),required:!0,minLength:8,autoComplete:"new-password",className:"w-full rounded-lg px-3 py-2.5 pr-10 text-sm focus:outline-none focus:ring-2",style:{backgroundColor:"var(--bg-primary)",color:"var(--text-primary)",border:"1px solid var(--border-primary)"}}),e.jsx("button",{type:"button",onClick:()=>w(e=>!e),className:"absolute right-3 top-1/2 -translate-y-1/2 transition-colors",style:{color:"var(--text-tertiary)"},tabIndex:-1,children:j?e.jsx(t,{size:18}):e.jsx(r,{size:18})})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1.5",style:{color:"var(--text-secondary)"},children:m("auth.resetPassword.confirmPassword")}),e.jsx("input",{type:j?"text":"password",value:v,onChange:e=>f(e.target.value),required:!0,minLength:8,autoComplete:"new-password",className:"w-full rounded-lg px-3 py-2.5 text-sm focus:outline-none focus:ring-2",style:{backgroundColor:"var(--bg-primary)",color:"var(--text-primary)",border:"1px solid var(--border-primary)"}})]}),e.jsxs("button",{type:"submit",disabled:N,className:"w-full rounded-lg py-2.5 text-sm font-medium transition-opacity hover:opacity-90 disabled:opacity-60 flex items-center justify-center gap-2",style:{backgroundColor:"var(--accent-orange-strong)",color:"var(--bg-primary)"},children:[N&&e.jsx(s,{className:"w-4 h-4 animate-spin"}),m(N?"auth.resetPassword.submitting":"auth.resetPassword.submit")]})]})]}),S&&e.jsx(i,{type:S.type,message:S.message,onClose:()=>k(null)})]})}export{u 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.