PageSourceSearch

https://www.xpark.ai/assets/ResetPassword-V_uk8l8N.js

js xpark.ai collected 2026-10-05 14:02:20 UTC 2,432 bytes, 1 lines download raw bytes

1import{u as j,c as N,r,d as i,j as s,L as y,W as S,I as h,B as E,o as C,s as f,t as c}from"./index-FWKSGZPO.js";import{L as x}from"./label--tnD4pjg.js";const R=C({password:f().min(8,"Mínimo 8 caracteres").max(72),confirm:f()}).refine(o=>o.password===o.confirm,{message:"As senhas não conferem",path:["confirm"]});function z(){j();const o=N(),[n,d]=r.useState(!1),[l,v]=r.useState(""),[u,w]=r.useState(""),[m,p]=r.useState(!1);r.useEffect(()=>{const{data:a}=i.auth.onAuthStateChange(e=>{(e==="PASSWORD_RECOVERY"||e==="SIGNED_IN")&&d(!0)});return i.auth.getSession().then(({data:e})=>{e.session&&d(!0)}),()=>a.subscription.unsubscribe()},[]);const g=async a=>{a.preventDefault();const e=R.safeParse({password:l,confirm:u});if(!e.success){c({title:"Revise a senha",description:e.error.issues[0].message,variant:"destructive"});return}p(!0);try{const{error:t}=await i.auth.updateUser({password:e.data.password});if(t)throw t;c({title:"Senha atualizada",description:"Agora você pode entrar com a nova senha."}),await i.auth.signOut(),o("/auth/parceiros",{replace:!0})}catch(t){const b=t instanceof Error?t.message:"Erro inesperado";c({title:"Não foi possível atualizar",description:b,variant:"destructive"})}finally{p(!1)}};return s.jsx("div",{className:"min-h-screen bg-paper px-4 py-12",children:s.jsxs("div",{className:"mx-auto flex max-w-md flex-col gap-8",children:[s.jsx(y,{to:"/",className:"self-start",children:s.jsx(S,{size:28})}),s.jsxs("div",{className:"rounded-2xl border border-ink/10 bg-white p-8 shadow-card",children:[s.jsx("h1",{className:"font-display text-2xl font-semibold text-ink",children:"Definir nova senha"}),s.jsx("p",{className:"mt-2 text-sm text-mute",children:n?"Escolha uma senha forte com pelo menos 8 caracteres.":"Validando link de recuperação..."}),s.jsxs("form",{onSubmit:g,className:"mt-6 space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(x,{htmlFor:"password",children:"Nova senha"}),s.jsx(h,{id:"password",type:"password",value:l,onChange:a=>v(a.target.value),autoComplete:"new-password",disabled:!n})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(x,{htmlFor:"confirm",children:"Confirmar senha"}),s.jsx(h,{id:"confirm",type:"password",value:u,onChange:a=>w(a.target.value),autoComplete:"new-password",disabled:!n})]}),s.jsx(E,{type:"submit",className:"w-full",disabled:m||!n,children:m?"Atualizando...":"Salvar nova senha"})]})]})]})})}export{z 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.