PageSourceSearch

https://itiuba.ba.gov.br/assets/ResetPassword-BPWnfPCP.js

js itiuba.ba.gov.br collected 2026-09-25 08:42:41 UTC 3,097 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-query-CAW0R6Fd.js";import{k as y,f as P,r as t}from"./vendor-react-BIBNHc4z.js";import{g as L,j as n,t as c,aM as R,v as o,x as l,k as d,B as m,bn as E,bu as I,L as p}from"./index-DxX8Lkqr.js";import{I as v}from"./input-CeFgxTaw.js";import{a as B}from"./auth-cidadao.service-BTJTYwib.js";import"./ui-radix-CMPBktV5.js";import"./utils-objBp_8x.js";const z=()=>{const[w]=y(),u=P(),{toast:r}=L(),h=w.get("token"),[a,g]=t.useState(""),[x,N]=t.useState(""),[f,j]=t.useState(!1),[S,C]=t.useState(!1);if(!h)return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-muted/30 p-4",children:e.jsxs(n,{className:"w-full max-w-md",children:[e.jsxs(c,{className:"text-center",children:[e.jsx(R,{className:"h-12 w-12 text-destructive mx-auto mb-2"}),e.jsx(o,{children:"Link inválido"}),e.jsx(l,{children:"O link de redefinição de senha é inválido ou está incompleto. Solicite um novo link."})]}),e.jsx(d,{children:e.jsx(m,{className:"w-full",onClick:()=>u("/esic"),children:"Voltar ao E-SIC"})})]})});if(S)return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-muted/30 p-4",children:e.jsxs(n,{className:"w-full max-w-md",children:[e.jsxs(c,{className:"text-center",children:[e.jsx(E,{className:"h-12 w-12 text-green-600 mx-auto mb-2"}),e.jsx(o,{children:"Senha redefinida!"}),e.jsx(l,{children:"Sua senha foi alterada com sucesso. Você já pode fazer login."})]}),e.jsx(d,{children:e.jsx(m,{className:"w-full",onClick:()=>u("/esic"),children:"Ir para o E-SIC"})})]})});const b=async s=>{if(s.preventDefault(),a.length<6){r({title:"Senha muito curta",description:"Mínimo de 6 caracteres.",variant:"destructive"});return}if(a!==x){r({title:"Senhas não conferem",description:"As senhas digitadas são diferentes.",variant:"destructive"});return}j(!0);try{await B.resetPassword(h,a),C(!0)}catch(i){const k=(i==null?void 0:i.message)||"Token inválido ou expirado. Solicite um novo link.";r({title:"Erro ao redefinir senha",description:k,variant:"destructive"})}finally{j(!1)}};return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-muted/30 p-4",children:e.jsxs(n,{className:"w-full max-w-md",children:[e.jsxs(c,{className:"text-center",children:[e.jsx(I,{className:"h-10 w-10 text-primary mx-auto mb-2"}),e.jsx(o,{children:"Redefinir Senha"}),e.jsx(l,{children:"Digite sua nova senha abaixo."})]}),e.jsx(d,{children:e.jsxs("form",{onSubmit:b,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{htmlFor:"password",children:"Nova senha"}),e.jsx(v,{id:"password",type:"password",value:a,onChange:s=>g(s.target.value),placeholder:"Mínimo 6 caracteres",required:!0,minLength:6})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{htmlFor:"confirmPassword",children:"Confirmar nova senha"}),e.jsx(v,{id:"confirmPassword",type:"password",value:x,onChange:s=>N(s.target.value),placeholder:"Repita a senha",required:!0,minLength:6})]}),e.jsx(m,{type:"submit",className:"w-full",disabled:f,children:f?"Redefinindo...":"Redefinir 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.