1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[841],{94947:function(s,e,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/new-password/[new-password]",function(){return r(31408)}])},31408:function(s,e,r){"use strict";r.r(e),r.d(e,{__N_SSP:function(){return c},default:function(){return d}});var a=r(85893),n=r(67335),o=r(67294),i=r(42283);r(28124);var t=r(65405),l=r(3614);r(33299);var c=!0;function d(s){let{confirmationToken:e="",id:r="",session:c}=s,{register:d,handleSubmit:u,errors:m,watch:h}=(0,i.cI)(),[f,w]=(0,o.useState)(!1),[p,x]=(0,o.useState)(!1),v=new l.Z;async function N(s){w(!1),x(!1);let e=s.password,r=s.newPassword;e&&r&&(v.user.password=e,await t.Z.changePassword(v).then(s=>{if(null!=s.id)return w(!0),window.location.href="/entrar";x(!0),console.error(s.message)},s=>{x(!0),console.error(s)}))}return(0,o.useEffect)(()=>{if(c&&(window.location.href="/"),!e||!r)return window.location.href="/recuperar-senha";(async function(){await t.Z.findByEcommerceUserId(r,e).then(s=>{if(!(v=s)||null!=v.user&&v.user.confirmationToken!=e)return window.location.href="/recuperar-senha"})})()}),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.Z,{title:"CERS - Nova senha"}),(0,a.jsx)("main",{className:"full-height",children:(0,a.jsxs)("div",{className:"container",children:[(0,a.jsxs)("div",{className:"section-title",children:[(0,a.jsx)("h1",{children:"Nova senha"}),(0,a.jsx)("p",{children:"Abaixo, insira sua nova senha e confirme para poder acessar sua conta:"})]}),(0,a.jsx)("form",{className:"form box-form password-form",onSubmit:u(N),autoComplete:"off",noValidate:!0,children:(0,a.jsxs)("div",{className:"form-grid",children:[(0,a.jsx)("div",{className:"form-grid-col col grid-12",children:(0,a.jsxs)("div",{className:"form-group",children:[(0,a.jsx)("label",{htmlFor:"password",children:"Insira sua nova senha *"}),(0,a.jsx)("input",{type:"password",id:"password",name:"password","aria-invalid":m.password?"true":"false",ref:d({required:"Campo obrigat\xf3rio",minLength:{value:6,message:"Utilize no m\xednimo 6 caracteres"}})}),m.password&&(0,a.jsx)("span",{className:"error",children:m.password.message})]})}),(0,a.jsx)("div",{className:"form-grid-col col grid-12",children:(0,a.jsxs)("div",{className:"form-group",children:[(0,a.jsx)("label",{htmlFor:"newPassword",children:"Confirmar sua nova senha *"}),(0,a.jsx)("input",{type:"password","aria-invalid":m.newPassword?"true":"false",id:"newPassword",name:"newPassword",ref:d({required:"Campo obrigat\xf3rio",validate:s=>s===h("password")||"As senhas n\xe3o s\xe3o iguais"})}),m.newPassword&&(0,a.jsx)("span",{className:"error",children:m.newPassword.message})]})}),(0,a.jsx)("div",{className:"form-grid-col col grid-12",children:(0,a.jsx)("div",{className:"form-group",children:(0,a.jsx)("button",{className:"btn-form btn-primary-reverse",type:"submit",children:"Atualizar senha"})})}),f&&(0,a.jsx)("div",{className:"alert alert--success text-center mt-3 mb-3",children:"Sua senha foi atualizada"}),p&&(0,a.jsx)("div",{className:"alert alert--error text-center",children:"N\xe3o foi poss\xedvel atualizar sua senha. Por favor, tente novamente em alguns minutos."})]})})]})})]})}}},function(s){s.O(0,[2283,9774,2888,179],function(){return s(s.s=94947)}),_N_E=s.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.