PageSourceSearch

https://forbes.it/assets/reimposta-password-Ccp_uhgM.js

js forbes.it collected 2026-10-01 09:12:06 UTC 2,497 bytes, 1 lines download raw bytes

1import{u as S,r as t,s as d,j as e,S as y,a as N,t as o}from"./index-BMSagvvg.js";import{L as x,I as f}from"./label-BHTm_J3F.js";import{B as h}from"./button-oebYcLu5.js";function P(){const c=S(),[n,i]=t.useState("wait"),[a,w]=t.useState(""),[u,g]=t.useState(""),[m,p]=t.useState(!1);t.useEffect(()=>{let s=!1;const{data:r}=d.auth.onAuthStateChange((l,b)=>{s||(l==="PASSWORD_RECOVERY"||b)&&(s=!0,i("ok"))});d.auth.getSession().then(({data:l})=>{s||l.session&&(s=!0,i("ok"))});const v=window.setTimeout(()=>{s||i("none")},4e3);return()=>{r.subscription.unsubscribe(),window.clearTimeout(v)}},[]);async function j(s){if(s.preventDefault(),a.length<8)return o.error("La password deve avere almeno 8 caratteri.");if(a!==u)return o.error("Le due password non coincidono.");p(!0);const{error:r}=await d.auth.updateUser({password:a});if(p(!1),r)return o.error(r.message);o.success("Password aggiornata: ora sei collegato."),c({to:"/dashboard"})}return e.jsxs("div",{className:"min-h-screen flex flex-col bg-forbes-bg text-forbes-ink",children:[e.jsx(y,{}),e.jsx("main",{className:"flex-1 flex items-start justify-center px-4 py-12 md:py-20",children:e.jsxs("div",{className:"w-full max-w-md",children:[e.jsx("div",{className:"text-[11px] font-semibold tracking-[0.18em] uppercase text-forbes-red",children:"Area lettore"}),e.jsx("h1",{className:"mt-2 font-serif text-4xl tracking-tight leading-none",children:"Reimposta la password"}),n==="wait"&&e.jsx("p",{className:"mt-6 text-forbes-muted",children:"Verifica del link in corso…"}),n==="none"&&e.jsxs("div",{className:"mt-6 space-y-4",children:[e.jsx("p",{className:"text-forbes-muted",children:"Il link non e' valido o e' scaduto. Richiedine uno nuovo dalla pagina di accesso con “Password dimenticata?”."}),e.jsx(h,{onClick:()=>c({to:"/auth"}),children:"Vai all'accesso"})]}),n==="ok"&&e.jsxs("form",{onSubmit:j,className:"mt-8 space-y-4",children:[e.jsxs("div",{children:[e.jsx(x,{htmlFor:"reset-pw",children:"Nuova password"}),e.jsx(f,{id:"reset-pw",type:"password",required:!0,minLength:8,autoComplete:"new-password",value:a,onChange:s=>w(s.target.value)})]}),e.jsxs("div",{children:[e.jsx(x,{htmlFor:"reset-pw2",children:"Ripeti la nuova password"}),e.jsx(f,{id:"reset-pw2",type:"password",required:!0,minLength:8,autoComplete:"new-password",value:u,onChange:s=>g(s.target.value)})]}),e.jsx(h,{type:"submit",className:"w-full",disabled:m,children:m?"Salvataggio…":"Salva la nuova password"})]})]})}),e.jsx(N,{})]})}export{P as component};

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.