PageSourceSearch

https://www.eqiqs.com/assets/ResetPasswordPage-BtHXNTru.js

js eqiqs.com collected 2026-10-02 00:18:41 UTC 6,170 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-ui-x7D0iLe8.js";import{r as a,j as F,L as c}from"./vendor-react-aMKJrssV.js";import{s as n,l as f,B as N,g as O,u as i}from"./index-CgmaCIwJ.js";import{I as v}from"./input-DqgkKQ22.js";import{L as P}from"./label-iymYxFO8.js";import{L as S}from"./loader-circle-BqgSt_yg.js";import{E as k}from"./eye-off-BpEVz-5C.js";import{E}from"./eye-BYAvdeaG.js";import"./vendor-data-LOeL2b27.js";const X=()=>{const[d,I]=a.useState(""),[p,R]=a.useState(""),[g,y]=a.useState(!1),[j,L]=a.useState(!1),[l,m]=a.useState(null),[u,C]=a.useState(!1),[x,Q]=a.useState(!1),q=F();a.useEffect(()=>{let t=!1,r=!1;const o=()=>{t||(r=!0,m(null),L(!0))},T=s=>{if(!s)return null;try{return decodeURIComponent(s.replace(/\+/g," "))}catch{return s}};(async()=>{const s=new URLSearchParams(window.location.hash.substring(1)),w=new URLSearchParams(window.location.search),b=T(w.get("error_description")??s.get("error_description"));if(b){r=!0,t||m(b);return}if(s.get("type")==="recovery"){o();return}const B=w.has("code"),{data:{session:D}}=await n.auth.getSession();if(D?.user){o();return}})();const h=window.setInterval(async()=>{if(r||t)return;const{data:{session:s}}=await n.auth.getSession();s?.user&&(o(),window.clearInterval(h))},1500),_=window.setTimeout(async()=>{if(r||t)return;window.clearInterval(h);const{data:{session:s}}=await n.auth.getSession();if(s?.user){o();return}r=!0,t||m("This reset link is invalid or has expired. Please request a new one.")},15e3),{data:{subscription:A}}=n.auth.onAuthStateChange(s=>{(s==="PASSWORD_RECOVERY"||s==="SIGNED_IN")&&o()});return()=>{t=!0,window.clearTimeout(_),window.clearInterval(h),A.unsubscribe()}},[]);const U=async t=>{if(t.preventDefault(),d.length<8){i.error("Password must be at least 8 characters");return}if(d!==p){i.error("Passwords do not match");return}y(!0);const{error:r}=await n.auth.updateUser({password:d});y(!1),r?r.message?.toLowerCase().includes("weak")||r.message?.toLowerCase().includes("known")?i.error("That password is too common. Try adding numbers, symbols, or making it longer (e.g. MyDog$Runs2Fast!)."):i.error(r.message):(i.success("Password updated successfully!"),q("/getting-started",{replace:!0}))};return!j&&!l?e.jsxs("div",{className:"min-h-dvh bg-background flex items-center justify-center px-6",children:[e.jsx(f,{title:"Reset Password — EQIQs",description:"Set a new password for your EQIQs account.",path:"/reset-password",noindex:!0}),e.jsxs("div",{className:"w-full max-w-sm text-center space-y-4",children:[e.jsx(S,{className:"h-8 w-8 animate-spin mx-auto text-primary"}),e.jsx("p",{className:"text-sm text-muted-foreground font-body",children:"Verifying your reset link…"}),e.jsxs("p",{className:"text-xs text-muted-foreground font-body",children:["If this takes too long, your link may have expired."," ",e.jsx(c,{to:"/login",className:"text-primary hover:underline",children:"Request a new one"})]})]})]}):!j&&l?e.jsxs("div",{className:"min-h-dvh bg-background flex items-center justify-center px-6",children:[e.jsx(f,{title:"Reset Link Expired — EQIQs",description:"Your password reset link is invalid or expired. Request a new one.",path:"/reset-password",noindex:!0}),e.jsxs("div",{className:"w-full max-w-sm text-center space-y-4",children:[e.jsx("p",{className:"text-sm text-destructive font-body",children:l}),e.jsx("p",{className:"text-xs text-muted-foreground font-body",children:"Go back to login and request a fresh password reset email."}),e.jsx(c,{to:"/login",className:"inline-block",children:e.jsx(N,{children:"Back to Log In"})})]})]}):e.jsxs("div",{className:"min-h-dvh bg-background flex items-center justify-center px-6",children:[e.jsx(f,{title:"Reset Password — EQIQs",description:"Set a new password for your EQIQs account.",path:"/reset-password",noindex:!0}),e.jsxs("div",{className:"w-full max-w-sm",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx(c,{to:"/",className:"inline-flex items-center gap-2 mb-6",children:e.jsx("div",{className:"h-10 w-10 rounded-xl bg-primary/20 flex items-center justify-center",children:e.jsx(O,{className:"h-5 w-5 text-primary"})})}),e.jsx("h1",{className:"text-2xl font-bold mb-1",children:"Set New Password"}),e.jsx("p",{className:"text-sm text-muted-foreground font-body",children:"Enter your new password below"})]}),e.jsxs("form",{onSubmit:U,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(P,{htmlFor:"newPassword",className:"font-body text-sm",children:"New Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(v,{id:"newPassword",type:u?"text":"password",placeholder:"Min. 8 characters",value:d,onChange:t=>I(t.target.value),required:!0,minLength:8,className:"pr-10"}),e.jsx("button",{type:"button",onClick:()=>C(!u),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",tabIndex:-1,
1children:u?e.jsx(k,{className:"h-4 w-4"}):e.jsx(E,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(P,{htmlFor:"confirmPassword",className:"font-body text-sm",children:"Confirm Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(v,{id:"confirmPassword",type:x?"text":"password",placeholder:"Repeat password",value:p,onChange:t=>R(t.target.value),required:!0,minLength:8,className:"pr-10"}),e.jsx("button",{type:"button",onClick:()=>Q(!x),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",tabIndex:-1,children:x?e.jsx(k,{className:"h-4 w-4"}):e.jsx(E,{className:"h-4 w-4"})})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground font-body",children:'Use 8+ characters with a mix of letters, numbers, and symbols. Avoid common passwords like "password123".'}),e.jsx(N,{type:"submit",className:"w-full",disabled:g,children:g?e.jsxs(e.Fragment,{children:[e.jsx(S,{className:"h-4 w-4 animate-spin mr-2"})," Updating…"]}):"Update Password"})]}),e.jsxs("p",{className:"text-center text-xs text-muted-foreground font-body mt-6",children:["Remember your password?"," ",e.jsx(c,{to:"/login",className:"text-primary hover:underline",children:"Log in"})]})]})]})};export{X 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.