PageSourceSearch

https://jostelektro.ch/assets/reset-password-CLfhTwP-.js

js jostelektro.ch collected 2026-10-08 21:28:37 UTC 2,699 bytes, 1 lines download raw bytes

1import{u as b,r as a,s as u,t as r,j as e,a as d,L as w}from"./index-B_gYwKqK.js";function j(){const i=b(),[m,x]=a.useState(!1),[n,p]=a.useState(""),[o,f]=a.useState(""),[l,c]=a.useState(!1);a.useEffect(()=>{let s=!1;return u.auth.getSession().then(({data:t})=>{s||(t.session?x(!0):(r.error("Ungültiger oder abgelaufener Link",{description:"Bitte fordere einen neuen Reset-Link an."}),i({to:"/login",replace:!0})))}),()=>{s=!0}},[i]);async function h(s){if(s.preventDefault(),!l){if(n!==o){r.error("Passwörter stimmen nicht überein");return}if(n.length<8){r.error("Passwort muss mindestens 8 Zeichen lang sein");return}c(!0);try{const{error:t}=await u.auth.updateUser({password:n});if(t)throw t;r.success("Passwort aktualisiert"),i({to:"/admin",replace:!0})}catch(t){r.error("Fehler",{description:t.message})}finally{c(!1)}}}return e.jsx("div",{className:"min-h-screen grid place-items-center bg-neutral-50 px-4",children:e.jsxs("div",{className:"w-full max-w-sm bg-white border rounded-xl p-6 shadow-sm",children:[e.jsx("div",{className:"text-xs uppercase tracking-wider text-black/50",children:"Jost Elektro AG · Admin"}),e.jsx("h1",{className:"text-2xl font-bold mt-1",children:"Neues Passwort"}),e.jsx("p",{className:"text-sm text-black/60 mt-1",children:"Mindestens 8 Zeichen."}),m?e.jsxs("form",{onSubmit:h,className:"mt-5 space-y-3",children:[e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"text-xs font-medium text-black/70",children:"Neues Passwort"}),e.jsx("input",{type:"password",required:!0,minLength:8,autoComplete:"new-password",value:n,onChange:s=>p(s.target.value),className:"mt-1 w-full rounded-md border bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-brand-yellow"})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"text-xs font-medium text-black/70",children:"Passwort wiederholen"}),e.jsx("input",{type:"password",required:!0,minLength:8,autoComplete:"new-password",value:o,onChange:s=>f(s.target.value),className:"mt-1 w-full rounded-md border bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-brand-yellow"})]}),e.jsxs("button",{type:"submit",disabled:l,className:"w-full bg-brand-yellow rounded-full px-5 py-2.5 text-sm font-medium inline-flex items-center justify-center gap-2 disabled:opacity-60",children:[l&&e.jsx(d,{className:"size-4 animate-spin"}),"Speichern"]})]}):e.jsx("div",{className:"mt-8 grid place-items-center text-black/40",children:e.jsx(d,{className:"size-5 animate-spin"})}),e.jsx("div",{className:"mt-6 text-center",children:e.jsx(w,{to:"/",className:"text-xs text-black/40 hover:text-black/70",children:"← Zurück zur Website"})})]})})}export{j 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.