PageSourceSearch

https://aabbooking.lovable.app/assets/nulstil-kodeord-Dpqb2Rjk.js

js aabbooking.lovable.app collected 2026-10-03 03:18:06 UTC 3,239 bytes, 1 lines download raw bytes

1import{u as B,r as a,s as n,j as e,L as w,t as d}from"./index-DKzk2fND.js";import{B as K}from"./button-uZOtdUFG.js";import{I as k}from"./input-DtQUfmlq.js";import{L as y}from"./label-DgJN-Lve.js";import{C as P,a as E,b as F,c as I,d as D}from"./card-BXu3dODC.js";import{a as H}from"./aab_logo.png.asset-4Ftlgn7j.js";function V(o){return/weak|easy to guess|pwned/i.test(o)?"Kodeordet er for nemt at gætte (fx kendt fra datalæk). Vælg et andet, gerne længere kodeord.":/different from the old/i.test(o)?"Det nye kodeord skal være forskelligt fra det gamle.":/at least|characters/i.test(o)?"Kodeordet er for kort.":o}function U(){const o=B(),[j,b]=a.useState(!0),[c,u]=a.useState(!1),[v,m]=a.useState(""),[i,N]=a.useState(""),[h,S]=a.useState(""),[f,p]=a.useState(!1);a.useEffect(()=>{const s=n.auth.onAuthStateChange((t,r)=>{r?.user&&(u(!0),m(r.user.email??""))});return(async()=>{const t=new URL(window.location.href),r=t.searchParams.get("code"),l=t.searchParams.get("token_hash"),L=t.searchParams.get("type")??"recovery",g=`verified:${l??r??""}`;try{(l||r)&&!sessionStorage.getItem(g)&&(sessionStorage.setItem(g,"1"),r?await n.auth.exchangeCodeForSession(r):await n.auth.verifyOtp({token_hash:l,type:L}),window.history.replaceState({},"",t.pathname))}catch{}const{data:x}=await n.auth.getSession();x.session?.user&&(u(!0),m(x.session.user.email??"")),b(!1)})(),()=>s.data.subscription.unsubscribe()},[]);async function C(s){if(s.preventDefault(),i.length<8)return d.error("Kodeord skal være mindst 8 tegn");if(i!==h)return d.error("Kodeordene er ikke ens");p(!0);const{error:t}=await n.auth.updateUser({password:i});if(p(!1),t)return d.error(V(t.message));d.success("Kodeord opdateret"),o({to:"/hjem"})}return j?null:e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:e.jsxs(P,{className:"w-full max-w-md",children:[e.jsxs(E,{className:"text-center",children:[e.jsx("div",{className:"mx-auto mb-3 h-16 w-16",children:e.jsx("img",{src:H.url,alt:"AaB af 1885 logo",className:"h-full w-full object-contain"})}),e.jsx(F,{children:"Vælg nyt kodeord"}),e.jsx(I,{children:c?`Vælg et nyt kodeord til ${v}.`:"Linket er ugyldigt eller udløbet. Bed om et nyt nulstillingslink."})]}),e.jsxs(D,{children:[c?e.jsxs("form",{onSubmit:C,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(y,{htmlFor:"password",children:"Nyt kodeord (mindst 8 tegn)"}),e.jsx(k,{id:"password",type:"password",autoComplete:"new-password",required:!0,value:i,onChange:s=>N(s.target.value)})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(y,{htmlFor:"password2",children:"Bekræft nyt kodeord"}),e.jsx(k,{id:"password2",type:"password",autoComplete:"new-password",required:!0,value:h,onChange:s=>S(s.target.value)})]}),e.jsx(K,{type:"submit",className:"w-full",disabled:f,children:f?"Gemmer…":"Gem nyt kodeord"})]}):e.jsx("p",{className:"text-center text-sm",children:e.jsx(w,{to:"/glemt-kodeord",className:"text-primary hover:underline",children:"Bed om nyt link"})}),e.jsx("p",{className:"mt-6 text-center text-sm",children:e.jsx(w,{to:"/auth",className:"text-primary hover:underline",children:"← Tilbage til login"})})]})]})})}export{U as component,V as oversaetFejl};

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.