PageSourceSearch

https://euroszkola-bis.pl/assets/konto.zmien-haslo-DFFOK-gc.js

js euroszkola-bis.pl collected 2026-10-07 20:36:50 UTC 3,095 bytes, 1 lines download raw bytes

1import{u as g,e as w,r as a,j as e,L as b,t as o,b as j}from"./index-D2Lffh5l.js";import{L as d}from"./loader-circle-CyUJbkEZ.js";import{A as y}from"./arrow-left-VfqQLPBn.js";import{K as f}from"./key-round-COT9CAst.js";import"./createLucideIcon-CJzItCWA.js";function C(){const{user:r,loading:i}=g(),m=w(),[n,p]=a.useState(""),[c,x]=a.useState(""),[l,u]=a.useState(!1);a.useEffect(()=>{!i&&!r&&m.navigate({to:"/login"})},[i,r,m]);async function h(t){if(t.preventDefault(),n.length<8){o.error("Hasło musi mieć minimum 8 znaków");return}if(n!==c){o.error("Hasła nie są identyczne");return}u(!0);try{const{error:s}=await j.auth.updateUser({password:n});if(s)throw s;o.success("Hasło zmienione"),m.navigate({to:"/konto/bezpieczenstwo"})}catch(s){o.error("Nie udało się zmienić hasła",{description:s instanceof Error?s.message:String(s)})}finally{u(!1)}}return i||!r?e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-soft",children:e.jsx(d,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-soft px-4 py-12",children:e.jsxs("div",{className:"w-full max-w-md rounded-3xl border border-border/60 bg-card p-8 shadow-elegant sm:p-10",children:[e.jsxs(b,{to:"/konto/bezpieczenstwo",className:"mb-4 inline-flex items-center gap-2 text-xs font-medium text-muted-foreground hover:text-foreground",children:[e.jsx(y,{className:"h-3 w-3"})," Bezpieczeństwo"]}),e.jsx("div",{className:"mb-4 inline-flex h-12 w-12 items-center justify-center rounded-xl bg-primary/10",children:e.jsx(f,{className:"h-6 w-6 text-primary"})}),e.jsx("h1",{className:"font-display text-2xl font-extrabold tracking-tight",children:"Zmień hasło"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:r.email}),e.jsxs("form",{onSubmit:h,className:"mt-6 space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"new-pw",className:"mb-1 block text-sm font-medium",children:"Nowe hasło"}),e.jsx("input",{id:"new-pw",type:"password",required:!0,minLength:8,maxLength:72,autoComplete:"new-password",value:n,onChange:t=>p(t.target.value),className:"w-full rounded-lg border border-input bg-background px-3 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-ring",placeholder:"Min. 8 znaków"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"confirm-pw",className:"mb-1 block text-sm font-medium",children:"Powtórz hasło"}),e.jsx("input",{id:"confirm-pw",type:"password",required:!0,minLength:8,maxLength:72,autoComplete:"new-password",value:c,onChange:t=>x(t.target.value),className:"w-full rounded-lg border border-input bg-background px-3 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsxs("button",{type:"submit",disabled:l,className:"inline-flex w-full items-center justify-center gap-2 rounded-full bg-primary px-5 py-3 text-sm font-bold text-primary-foreground hover:scale-[1.01] disabled:opacity-60",children:[l?e.jsx(d,{className:"h-4 w-4 animate-spin"}):e.jsx(f,{className:"h-4 w-4"}),l?"Zmieniam...":"Zmień hasło"]})]})]})})}export{C 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.