PageSourceSearch

https://www.vcn.be/assets/ResetPasswordPage-CvjRrgY1.js

js vcn.be collected 2026-10-08 08:08:21 UTC 7,908 bytes, 1 lines download raw bytes

1import{c as R,r as o,j as e}from"./vendor-react-DtVE4p7m.js";import{k as W,s as u,i as p}from"./index-CuIfIfPZ.js";import{I as v}from"./input-FK_Vqpem.js";import{B as V}from"./button-BbC7hWJa.js";import{C as M,b as z,c as A,d as D,a as F}from"./card-M5gKzrRd.js";import{H as G}from"./Header-Cj12uFXT.js";import{F as I}from"./Footer-DLZa2Uju.js";import U from"./ThermalBackground-gzuLShJJ.js";import{L as B}from"./lock-D0GWofbz.js";import{L as N}from"./loader-circle-CZSQyEiL.js";import{E as O}from"./eye-off-DhQc7r6t.js";import{E as $}from"./eye-DCT8QJoe.js";import{C as H}from"./check-C9orChF5.js";import{X as T}from"./x-B1pGnJqQ.js";import"./vendor-supabase-6P6EowNV.js";import"./index-CbwLjnrV.js";import"./halo-DgJMmm_r.js";import"./createLucideIcon-SnDx3gtb.js";import"./rangsFidelite-jfgCu9F-.js";import"./gift-CSaEZ3We.js";import"./clock-CrvVV96c.js";import"./mail-BQDDviC2.js";import"./star-nFd_wCuZ.js";import"./zap-DF0qDEhc.js";import"./phone-D_6SWHU8.js";import"./useSubscriptionStatus-o53oXayg.js";import"./usePerfMode-C-R8hjyp.js";import"./avatars-D_u09z8W.js";import"./user-BzG5OAmz.js";import"./useQuery-CWWGdF8d.js";import"./logo-vcn-CA5Iw-V2.js";import"./use-floating-dropdown-DAs6Ic1C.js";import"./cheminLocalise-nuBuak1s.js";import"./droplets-DPcc_W2l.js";import"./wrench-CJIMx8mH.js";import"./chevron-right-DQYHMVum.js";import"./snowflake-BiQat_50.js";import"./calculator-CZ1PsFca.js";import"./arrow-right-ztlyhmiM.js";import"./fuel-DuzlHigq.js";import"./trending-up-D2es9xZN.js";import"./trophy-oojQI8ar.js";import"./tag-DDT2Xl49.js";import"./flame-BmVsx4_6.js";import"./settings-DWvSeYun.js";import"./euro-Bmx1p65G.js";import"./triangle-alert-DfAYi5Rt.js";import"./wind-DWen5uXy.js";import"./house-DN3P2cHX.js";import"./circle-alert-DK4zipd-.js";import"./calendar-rsFpKxf2.js";import"./arrow-up-right-CLLkChhX.js";import"./map-pin-BuvcVW5d.js";import"./send-mcUvXyjf.js";const d={minLength:8,hasUppercase:/[A-Z]/,hasLowercase:/[a-z]/,hasNumber:/[0-9]/,hasSpecialChar:/[!@#$%^&*(),.?":{}|<>_\-+=\[\]\\\/`~;']/},b={fr:{title:"Nouveau mot de passe",subtitle:"Choisissez un nouveau mot de passe pour votre compte",newPassword:"Nouveau mot de passe",confirmPassword:"Confirmer le mot de passe",submit:"Enregistrer le mot de passe",success:"Mot de passe modifié avec succès !",errorMismatch:"Les mots de passe ne correspondent pas",errorWeak:"Le mot de passe ne respecte pas les critères",errorGeneric:"Erreur lors de la modification du mot de passe",errorExpired:"Le lien a expiré. Veuillez demander un nouveau lien.",loading:"Vérification en cours...",minLength:"8 caractères minimum",uppercase:"1 majuscule",lowercase:"1 minu
1scule",number:"1 chiffre",special:"1 caractère spécial (!@#$%...)",accountRoute:"/fr/compte"},nl:{title:"Nieuw wachtwoord",subtitle:"Kies een nieuw wachtwoord voor uw account",newPassword:"Nieuw wachtwoord",confirmPassword:"Bevestig wachtwoord",submit:"Wachtwoord opslaan",success:"Wachtwoord succesvol gewijzigd!",errorMismatch:"Wachtwoorden komen niet overeen",errorWeak:"Wachtwoord voldoet niet aan de vereisten",errorGeneric:"Fout bij het wijzigen van het wachtwoord",errorExpired:"De link is verlopen. Vraag een nieuwe link aan.",loading:"Verificatie bezig...",minLength:"Minimaal 8 tekens",uppercase:"1 hoofdletter",lowercase:"1 kleine letter",number:"1 cijfer",special:"1 speciaal teken (!@#$%...)",accountRoute:"/nl/account"},en:{title:"New password",subtitle:"Choose a new password for your account",newPassword:"New password",confirmPassword:"Confirm password",submit:"Save password",success:"Password changed successfully!",errorMismatch:"Passwords do not match",errorWeak:"Password does not meet requirements",errorGeneric:"Error changing password",errorExpired:"The link has expired. Please request a new link.",loading:"Verifying...",minLength:"At least 8 characters",uppercase:"1 uppercase letter",lowercase:"1 lowercase letter",number:"1 number",special:"1 special character (!@#$%...)",accountRoute:"/en/account"}},_e=()=>{const{language:c}=W(),y=R(),s=b[c]||b.fr,[r,C]=o.useState(""),[m,S]=o.useState(""),[i,L]=o.useState(!1),[x,f]=o.useState(!1),[P,h]=o.useState(!0),[E,w]=o.useState(!1);o.useEffect(()=>{const{data:{subscription:t}}=u.auth.onAuthStateChange((a,j)=>{(a==="PASSWORD_RECOVERY"||a==="SIGNED_IN")&&(w(!0),h(!1))});return u.auth.getSession().then(({data:{session:a}})=>{a?(w(!0),h(!1)):setTimeout(()=>{u.auth.getSession().then(({data:{session:j}})=>{j&&w(!0),h(!1)})},3e3)}),()=>t.unsubscribe()},[]);const n={minLength:r.length>=d.minLength,hasUppercase:d.hasUppercase.test(r),hasLowercase:d.hasLowercase.test(r),hasNumber:d.hasNumber.test(r),hasSpecialChar:d.hasSpecialChar.test(r)},g=Object.values(n).every(Boolean),k=async t=>{if(t.preventDefault(),!g){p.error(s.errorWeak);return}if(r!==m){p.error(s.errorMismatch);return}f(!0);try{const{error:a}=await u.auth.updateUser({password:r});a?(console.error("[ResetPassword] Error:",a),p.error(s.errorGeneric)):(p.success(s.success),y(s.accountRoute,{replace:!0}))}catch{p.error(s.errorGeneric)}finally{f(!1)}},l=({valid:t,text:a})=>e.jsxs("div",{className:`flex items-center gap-1.5 text-xs ${t?"text-green-500":"text-muted-foreground"}`,children:[t?e.jsx(H,{className:"w-3 h-3"}):e.jsx(T,{className:"w-3 h-3"}),e.jsx("span",{children:a})]});return e.jsxs("div",{className:"min-h-screen flex flex-col",children:[e.jsx(U,{}),e.jsx(G,{}),e.jsx("main",{className:"flex-1 flex items-center justify-center px-4 py-20",children:e.jsxs(M,{className:"w-full max-w-md",children:[e.jsxs(z,{className:"text-center",children:[e.jsx("div",{className:"mx-auto mb-4 w-14 h-14 rounded-2xl bg-primary/20 border border-primary/40 flex items-center justify-center",children:e.jsx(B,{className:"w-7 h-7 text-primary"})}),e.jsx(A,{className:"text-xl",children:s.title}),e.jsx(D,{children:s.subtitle})]}),e.jsx(F,{children:P?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[e.jsx(N,{className:"w-8 h-8 animate-spin text-primary"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.loading})]}):E?e.jsxs("form",{onSubmit:k,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"reset-new-password",className:"text-sm font-medium",children:s.newPassword}),e.jsxs("div",{className:"relative",children:[e.jsx(v,{id:"reset-new-password",autoComplete:"new-password",type:i?"text":"password",value:r,onChange:t=>C(t.target.value),className:"pr-10",autoFocus:!0}),e.jsx("button",{type:"button",onClick:()=>L(!i),"aria-label":i?c==="nl"?"Wachtwoord verbergen":c==="en"?"Hide password":"Masquer le mot de passe":c==="nl"?"Wachtwoord tonen":c==="en"?"Show password":"Afficher le mot de passe","aria-pressed":i,className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:i?e.jsx(O,{className:"w-4 h-4"}):e.jsx($,{className:"w-4 h-4"})})]}),r.length>0&&e.jsxs("div",{className:"grid grid-cols-2 gap-1 mt-2",children:[e.jsx(l,{valid:n.minLength,text:s.minLength}),e.jsx(l,{valid:n.hasUppercase,text:s.uppercase}),e.jsx(l,{valid:n.hasLowercase,text:s.lowercase}),e.jsx(l,{valid:n.hasNumber,text:s.number}),e.jsx(l,{valid:n.hasSpecialChar,text:s.special})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"reset-confirm-password",className:"text-sm font-medium",children:s.confirmPassword}),e.jsx(v,{id:"reset-confirm-password",autoComplete:"new-password",type:i?"text":"password",value:m,onChange:t=>S(t.target.value)}),m.length>0&&r!==m&&e.jsx("p",{className:"text-xs text-destructive",children:s.errorMismatch})]}),e.jsxs(V,{type:"submit",className:"w-full",variant:"premium",disabled:x||!g||r!==m,children:[x?e.jsx(N,{className:"w-4 h-4 animate-spin mr-2"}):null,s.submit]})]}):e.jsx("div",{className:"text-center py-8",children:e.jsx("p",{className:"text-sm text-destructive",children:s.errorExpired})})})]})}),e.jsx(I,{})]})};export{_e 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.