1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[148],{9294:function(e,a,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/cambiar-contrasena",function(){return s(1867)}])},1867:function(e,a,s){"use strict";s.r(a),s.d(a,{__N_SSP:function(){return u},default:function(){return d}});var r=s(5893),t=s(7294),n=s(6939),o=s(5980),l=s(5900),c=s(6326);let i={backgroundColor:"#003da5",color:"#fff",border:"none",minWidth:"140px"};var u=!0;function d(e){let{metatags:a,userName:s,userEmail:u}=e,[d,m]=(0,t.useState)(!1),[h,p]=(0,t.useState)(""),[f,x]=(0,t.useState)(""),[j,w]=(0,t.useState)(""),[N,g]=(0,t.useState)(""),[b,v]=(0,t.useState)(!1),_=async e=>{if(e.preventDefault(),g(""),f.length<8){g("La nueva contrase\xf1a debe tener al menos 8 caracteres.");return}if(f!==j){g("Las contrase\xf1as no coinciden.");return}m(!0);try{let e=await fetch("/api/auth/change-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPassword:h,newPassword:f})});if(e.ok)v(!0);else{let a=await e.json().catch(()=>({}));g((null==a?void 0:a.message)||"No fue posible actualizar la contrase\xf1a.")}}catch(e){console.error(e),g("No fue posible actualizar la contrase\xf1a.")}finally{m(!1)}};return(0,r.jsxs)(r.Fragment,{children:[d&&(0,r.jsx)(c.a,{}),(0,r.jsx)(n.Z,{metatags:a,userName:s}),(0,r.jsx)(l.Z,{userName:s}),(0,r.jsxs)("section",{className:"container my-5",style:{maxWidth:"480px"},children:[(0,r.jsx)("h2",{className:"pb-3 pt-4",children:"Cambiar contrase\xf1a"}),b?(0,r.jsxs)("div",{className:"alert alert-success",role:"alert",children:[(0,r.jsxs)("p",{className:"mb-1",children:[(0,r.jsx)("strong",{children:"\xa1Listo!"})," Tu contrase\xf1a se actualiz\xf3."]}),(0,r.jsx)("a",{href:"http://www.agencia.alamoargentina.com.ar",children:"Volver al inicio"})]}):(0,r.jsxs)("form",{onSubmit:_,noValidate:!0,children:[(0,r.jsxs)("p",{children:["Cuenta: ",(0,r.jsx)("strong",{children:u})]}),(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{htmlFor:"currentPassword",children:"Contrase\xf1a actual"}),(0,r.jsx)("input",{type:"password",id:"currentPassword",className:"form-control",autoComplete:"current-password",value:h,onChange:e=>p(e.target.value)})]}),(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{htmlFor:"newPassword",children:"Nueva contrase\xf1a"}),(0,r.jsx)("input",{type:"password",id:"newPassword",className:"form-control",autoComplete:"new-password",placeholder:"M\xednimo 8 caracteres",value:f,onChange:e=>x(e.target.value)})]}),(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{htmlFor:"confirm",children:"Repetir nueva contrase\xf1a"}),(0,r.jsx)("input",{type:"password",id:"confirm",className:"form-control",autoComplete:"new-password",value:j,onChange:e=>w(e.target.value)})]}),N&&(0,r.jsx)("div",{className:"alert alert-danger",role:"alert",children:N}),(0,r.jsx)("button",{type:"submit",className:"btn",style:i,disabled:d,children:"Guardar"})]})]}),(0,r.jsx)(o.Z,{userData:!0})]})}}},function(e){e.O(0,[714,64,775,900,888,774,179],function(){return e(e.s=9294)}),_N_E=e.O()}]);
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.