PageSourceSearch

https://minimyway.com/assets/reset-password-C30S9kVC.js

js minimyway.com collected 2026-10-09 18:05:26 UTC 5,207 bytes, 1 lines download raw bytes

1import{u as k,s as l,j as e,L as d}from"./index-BY02FwW_.js";import{a as r,b as P,F as E,E as R,w as L,A}from"./lucide-DLCf5ruO.js";import{B as F}from"./button-w2mjY-Mr.js";import{I as f}from"./input-CyxZ7beJ.js";import{L as g}from"./label-BIPi1VPD.js";const M="/assets/minimyway-logo-DsEMPMyA.png";function W(){const b=k(),[a,w]=r.useState(""),[m,j]=r.useState(""),[o,y]=r.useState(!1),[c,n]=r.useState(""),[u,x]=r.useState(!1),[N,v]=r.useState(!1),[h,p]=r.useState(null);r.useEffect(()=>{let s=!0;const{data:t}=l.auth.onAuthStateChange((i,C)=>{s&&(i==="PASSWORD_RECOVERY"||C)&&p(!0)});return l.auth.getSession().then(({data:i})=>{s&&p(!!i.session)}),()=>{s=!1,t.subscription.unsubscribe()}},[]);const S=async s=>{if(s.preventDefault(),n(""),a.length<6){n("Password must be at least 6 characters.");return}if(a!==m){n("Passwords don't match.");return}x(!0);try{const{error:t}=await l.auth.updateUser({password:a});if(t)throw t;v(!0),setTimeout(()=>b({to:"/edit"}),1600)}catch(t){n((t==null?void 0:t.message)||"Couldn't update your password. Please try again.")}finally{x(!1)}};return e.jsxs("main",{className:"relative min-h-screen overflow-hidden bg-background",children:[e.jsxs("div",{className:"pointer-events-none absolute inset-0",children:[e.jsx("div",{className:"absolute -top-40 -left-40 h-[28rem] w-[28rem] rounded-full bg-primary/15 blur-3xl"}),e.jsx("div",{className:"absolute -bottom-40 -right-32 h-[26rem] w-[26rem] rounded-full bg-[oklch(0.85_0.12_160)]/25 blur-3xl"})]}),e.jsx("section",{className:"relative flex min-h-screen items-center justify-center px-5 py-10 sm:px-8",children:e.jsxs("div",{className:"w-full max-w-sm",children:[e.jsx("div",{className:"mb-8 flex flex-col items-center text-center",children:e.jsx(d,{to:"/","aria-label":"MiniMyWay.com home",className:"inline-flex items-center rounded-2xl bg-white px-3.5 py-2 shadow-sm ring-1 ring-border/40",children:e.jsx("img",{src:M,alt:"MiniMyWay.com",className:"h-7 w-auto"})})}),N?e.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/70 p-6 text-center shadow-sm backdrop-blur-sm",children:[e.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-2xl bg-primary/10",children:e.jsx(P,{className:"h-6 w-6 text-primary"})}),e.jsx("h1",{className:"text-[22px] font-bold tracking-tight text-foreground",children:"Password updated"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"You're all set — taking you to your editor…"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-7 text-center",children:[e.jsx("h1",{className:"text-[26px] font-bold tracking-tight text-foreground sm:text-[28px]",children:"Set a new password"}),e.jsx("p",{className:"mt-1.5 text-sm text-muted-foreground",children:"Choose something secure you'll remember."})]}),h===!1&&e.jsxs("div",{className:"mb-4 rounded-xl border border-amber-500/40 bg-amber-500/10 px-3.5 py-2.5 text-sm text-amber-700 dark:text-amber-400",children:["This reset link is invalid or expired."," ",e.jsx(d,{to:"/forgot-password",className:"font-medium underline",children:"Request a new link"}),"."]}),e.jsxs("form",{onSubmit:S,className:"space-y-4",noValidate:!0,children:[c&&e.jsx("div",{role:"alert",className:"rounded-xl border border-destructive/40 bg-destructive/10 px-3.5 py-2.5 text-sm text-destructive",children:c}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(g,{htmlFor:"password",className:"text-[13px] font-medium",children:"New password"}),e.jsxs("div",{className:"relative",children:[e.jsx(f,{id:"password",type:o?"text":"password",autoComplete:"new-password",value:a,onChange:s=>w(s.target.value),required:!0,minLength:6,placeholder:"At least 6 characters",className:"h-11 rounded-xl pr-11 text-[15px] sm:h-10 sm:text-sm"}),e.jsx("button",{type:"button",onClick:()=>y(s=>!s),"aria-label":o?"Hide password":"Show password",className:"absolute right-1 top-1/2 -translate-y-1/2 inline-flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:o?e.jsx(E,{className:"h-4 w-4"}):e.jsx(R,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(g,{htmlFor:"confirm",className:"text-[13px] font-medium",children:"Confirm password"}),e.jsx(f,{id:"confirm",type:o?"text":"password",autoComplete:"new-password",value:m,onChange:s=>j(s.target.value),required:!0,minLength:6,placeholder:"Re-enter your password",className:"h-11 rounded-xl text-[15px] sm:h-10 sm:text-sm"})]}),e.jsx(F,{type:"submit",disabled:u||h===!1,className:"group h-11 w-full rounded-xl bg-gradient-primary text-[15px] font-semibold shadow-sm transition-all hover:opacity-95 hover:shadow-md disabled:opacity-70 sm:h-10 sm:text-sm",children:u?e.jsxs(e.Fragment,{children:[e.jsx(L,{className:"mr-2 h-4 w-4 animate-spin"}),"Updating…"]}):e.jsxs(e.Fragment,{children:["Update password",e.jsx(A,{className:"ml-1.5 h-4 w-4 transition-transform group-hover:translate-x-0.5"})]})})]}),e.jsxs("p",{className:"mt-7 text-center text-sm text-muted-foreground",children:["Back to"," ",e.jsx(d,{to:"/login",className:"font-semibold text-primary hover:underline",children:"log in"})]})]})]})})]})}export{W 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.