PageSourceSearch

https://www.nexcert.com.br/assets/ResetPasswordPage-D0R1cDsU.js

js nexcert.com.br collected 2026-10-06 04:37:30 UTC 3,596 bytes, 1 lines download raw bytes

1import{r as c,j as s}from"./tanstack-B11EsWYi.js";import{u as g,o as v,s as j}from"./forms-Ca4NLq9R.js";import{a as S,A as y}from"./AuthLayout-B3YZXNqf.js";import{z as u}from"./toast-Ce8id6-5.js";import{a as N,s as i,L as b,B as P,d as R,m as C}from"./index-CvhFWbzm.js";import{L as l}from"./label-sEbPjgb5.js";import{P as p,a as L,p as A}from"./PasswordStrengthMeter-C01of-3a.js";import{u as E}from"./usePageMeta-CKe9hAzG.js";import{K as h,a6 as k,a as V}from"./icons-DoiDSXQU.js";import"./radix-Di04DmVr.js";import"./supabase-DrKaZfNY.js";import"./react-D0xWJm0d.js";import"./charts-DYDu4-Vk.js";import"./input-DQqSS50h.js";const D=v({password:A,confirmPassword:j().min(1,"Confirme sua senha")}).refine(a=>a.password===a.confirmPassword,{path:["confirmPassword"],message:"As senhas não coincidem"});function H(){E({title:"Redefinir senha — Painel Admin",description:"Defina uma nova senha segura para sua conta no Painel Admin."});const a=N(),[n,m]=c.useState("checking"),e=g({resolver:S(D),mode:"onChange",defaultValues:{password:"",confirmPassword:""}}),d=e.watch("password")??"";c.useEffect(()=>{let r=!1;const{data:t}=i.auth.onAuthStateChange((o,w)=>{(o==="PASSWORD_RECOVERY"||o==="SIGNED_IN"&&w)&&(r=!0,m("ready"))}),x=setTimeout(async()=>{if(r)return;const{data:o}=await i.auth.getSession();m(o.session?"ready":"invalid")},800);return()=>{t.subscription.unsubscribe(),clearTimeout(x)}},[]);const f=async r=>{const{error:t}=await i.auth.updateUser({password:r.password});if(t){u.error(R(t));return}u.success(C.auth.passwordResetSuccess,{duration:6e3}),await i.auth.signOut(),a("/login",{replace:!0})};return s.jsxs(y,{eyebrow:"Nova senha",title:"Defina uma nova senha",subtitle:"Escolha uma senha forte. Você precisará dela para acessar sua conta.",children:[n==="checking"&&s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(h,{className:"h-6 w-6 animate-spin text-muted-foreground"})}),n==="invalid"&&s.jsxs("div",{className:"space-y-5",children:[s.jsx("div",{className:"rounded-xl border border-destructive/40 bg-destructive/5 p-4 text-sm text-destructive",children:"Link inválido ou expirado. Solicite um novo link de redefinição."}),s.jsxs(b,{to:"/forgot-password",className:"flex items-center justify-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(k,{className:"h-4 w-4"}),"Solicitar novo link"]})]}),n==="ready"&&s.jsxs("form",{onSubmit:e.handleSubmit(f),className:"space-y-5",noValidate:!0,children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(l,{htmlFor:"rp-password",className:"text-sm font-medium",children:"Nova senha"}),s.jsx(p,{id:"rp-password",placeholder:"Crie uma senha forte",maxLength:128,autoComplete:"new-password",...e.register("password")}),d.length>0&&s.jsx(L,{value:d}),e.formState.errors.password&&s.jsx("p",{className:"text-xs text-destructive",children:e.formState.errors.password.message})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(l,{htmlFor:"rp-confirm",className:"text-sm font-medium",children:"Confirme sua senha"}),s.jsx(p,{id:"rp-confirm",placeholder:"Repita a senha",maxLength:128,autoComplete:"new-password",...e.register("confirmPassword")}),e.formState.errors.confirmPassword&&s.jsx("p",{className:"text-xs text-destructive",children:e.formState.errors.confirmPassword.message})]}),s.jsxs(P,{type:"submit",className:"h-11 w-full text-sm font-medium shadow-sm",disabled:e.formState.isSubmitting,children:[e.formState.isSubmitting?s.jsx(h,{className:"h-4 w-4 animate-spin"}):s.jsx(V,{className:"h-4 w-4"}),"Redefinir senha"]})]})]})}export{H 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.