PageSourceSearch

https://irpa2026colombia.org/assets/ResetPassword-7lWFc8wV.js

js irpa2026colombia.org collected 2026-10-08 03:16:43 UTC 4,497 bytes, 1 lines download raw bytes

1import{r as m,d as S,u as F,s as i,j as e,B as E}from"./index-DnVm687U.js";import{o as P,s as f,u as R,a as T,F as L,b as h,c as w,d as j,e as g}from"./form-CETOqwtM.js";import{H as z,F as I}from"./Footer-Bvqa_r8G.js";import{C as O,b as k,c as A,d as D,a as V}from"./card-CRFaJYNz.js";import{F as b}from"./floating-label-input-CPARRe0H.js";import{K as H}from"./key-round-K7wKfepe.js";import"./label-BWZGrcrB.js";import"./dropdown-menu-elZyZctl.js";import"./index-B-Wc5f3e.js";import"./Combination-D1NCdNup.js";import"./index-C7OIboLl.js";import"./shield-BN1RiLGr.js";import"./log-out-CtUQRbPX.js";import"./search-BNZJvCG8.js";import"./mail-BBtFmBsn.js";import"./eye-off-BgwrI24M.js";import"./eye-Bub6U8nG.js";const M=P({password:f().min(8,"La contraseña debe tener al menos 8 caracteres"),confirmPassword:f().min(8,"La confirmación debe tener al menos 8 caracteres")}).refine(n=>n.password===n.confirmPassword,{message:"Las contraseñas no coinciden",path:["confirmPassword"]}),oe=()=>{const[n,x]=m.useState(!1),[v,d]=m.useState(!1),[y,c]=m.useState(!0),{toast:l}=S(),p=F(),u=R({resolver:T(M),defaultValues:{password:"",confirmPassword:""}});m.useEffect(()=>{let s=!1,a=!1;const{data:{subscription:t}}=i.auth.onAuthStateChange((o,r)=>{s||(o==="PASSWORD_RECOVERY"?(a=!0,d(!0),c(!1)):o==="SIGNED_IN"&&(r!=null&&r.user)&&(d(!0),c(!1)))});(async()=>{var r;const{data:o}=await i.auth.getSession();s||(r=o.session)!=null&&r.user&&(d(!0),c(!1))})();const C=window.setTimeout(async()=>{var r;if(s)return;const{data:o}=await i.auth.getSession();s||((r=o.session)!=null&&r.user||a?(d(!0),c(!1)):(c(!1),l({title:"Enlace inválido",description:"Este enlace de recuperación no es válido o ha expirado",variant:"destructive"}),p("/")))},1500);return()=>{s=!0,window.clearTimeout(C),t.unsubscribe()}},[p,l]);const N=async s=>{x(!0);try{const{error:a}=await i.auth.updateUser({password:s.password});if(a){let t="Ocurrió un error al actualizar la contraseña";a.message.includes("same")?t="La nueva contraseña debe ser diferente a la anterior":a.message.includes("weak")&&(t="La contraseña es demasiado débil. Usa al menos 8 caracteres con letras y números"),l({title:"Error al actualizar contraseña",description:t,variant:"destructive"});return}l({title:"Contraseña actualizada",description:"Tu contraseña ha sido actualizada exitosamente. Redirigiendo al inicio de sesión..."});try{await i.auth.signOut()}catch{}try{await i.auth.signOut({scope:"local"})}catch{}setTimeout(()=>{window.location.href="/inscribirme"},2e3)}catch(a){let t="Ocurrió un error al actualizar la contraseña";a.message.includes("same")&&(t="La nueva contraseña debe ser diferente a la anterior"),l({title:"Error",description:t,variant:"destructive"})}finally{x(!1)}};return e.jsxs("div",{className:"min-h-screen",children:[e.jsx(z,{}),e.jsxs("main",{className:"pt-20 pb-20",children:[e.jsx("section",{className:"py-12 gradient-hero text-white",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsxs("div",{className:"max-w-2xl mx-auto text-center",children:[e.jsx(H,{className:"h-16 w-16 mx-auto mb-6"}),e.jsx("h1",{className:"text-4xl md:text-5xl font-bold mb-4",children:"Restablecer Contraseña"}),e.jsx("p",{className:"text-xl text-white/90",children:"Ingresa tu nueva contraseña"})]})})}),e.jsx("section",{className:"py-12 bg-background",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsx("div",{className:"max-w-md mx-auto",children:e.jsxs(O,{children:[e.jsxs(k,{children:[e.jsx(A,{children:"Nueva Contraseña"}),e.jsx(D,{children:"Elige una contraseña segura de al menos 8 caracteres"})]}),e.jsx(V,{children:y?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"Verificando enlace de recuperación..."}):v?e.jsx(L,{...u,children:e.jsxs("form",{onSubmit:u.handleSubmit(N),className:"space-y-6",children:[e.jsx(h,{control:u.control,name:"password",render:({field:s,fieldState:a})=>e.jsxs(w,{children:[e.jsx(j,{children:e.jsx(b,{label:"Nueva Contraseña",type:"password",error:!!a.error,showPasswordToggle:!0,...s})}),e.jsx(g,{})]})}),e.jsx(h,{control:u.control,name:"confirmPassword",render:({field:s,fieldState:a})=>e.jsxs(w,{children:[e.jsx(j,{children:e.jsx(b,{label:"Confirmar Contraseña",type:"password",error:!!a.error,showPasswordToggle:!0,...s})}),e.jsx(g,{})]})}),e.jsx(E,{type:"submit",className:"w-full",size:"lg",disabled:n,children:n?"Actualizando...":"Actualizar Contraseña"})]})}):null})]})})})})]}),e.jsx(I,{})]})};export{oe 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.