PageSourceSearch

https://mostreams-com.lovable.app/assets/reset-password-CQjOvFBZ.js

js mostreams-com.lovable.app collected 2026-10-03 03:35:02 UTC 3,712 bytes, 1 lines download raw bytes

1import{z as v,r as a,s as o,j as e,a2 as x,a1 as C,L as k,B as S,v as n}from"./index-BNrdOJig.js";import{P as m}from"./PasswordInput-BoQscDYM.js";import{K as P}from"./key-round-B63eJ-WV.js";import"./eye-off-DKZjR1l7.js";import"./eye-D8eAoNYW.js";function D(){const p=v(),[h,l]=a.useState(!1),[f,i]=a.useState(!1),[r,w]=a.useState(""),[d,b]=a.useState(""),[c,u]=a.useState(!1),[g,j]=a.useState(!1);a.useEffect(()=>{const{data:t}=o.auth.onAuthStateChange((s,y)=>{(s==="PASSWORD_RECOVERY"||y)&&i(!0),l(!0)});return o.auth.getSession().then(({data:s})=>{s.session&&i(!0),l(!0)}),()=>t.subscription.unsubscribe()},[]);async function N(t){if(t.preventDefault(),r.length<8)return n.error("Password must be at least 8 characters");if(r!==d)return n.error("Passwords don't match");u(!0);try{const{error:s}=await o.auth.updateUser({password:r});if(s)throw s;j(!0),n.success("Password updated"),setTimeout(()=>p({to:"/login"}),1500)}catch(s){n.error(s?.message||"Could not update password")}finally{u(!1)}}return e.jsx("main",{className:"relative min-h-screen w-full bg-[radial-gradient(circle_at_20%_20%,#78350f_0%,#000_55%)] flex items-center justify-center px-6 py-16",children:e.jsxs("div",{className:"w-full max-w-md",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 rounded-full border border-orange-500/40 bg-orange-500/15 text-orange-300 px-3 py-1 text-[10px] font-bold uppercase tracking-[0.2em]",children:[e.jsx(P,{className:"w-3.5 h-3.5"})," Set New Password"]}),e.jsxs("h1",{className:"mt-6 font-display font-black text-4xl md:text-5xl tracking-tight text-white",children:["Choose a ",e.jsx("span",{className:"text-orange-400",children:"new password"})]})]}),e.jsx("div",{className:"rounded-3xl border border-orange-500/40 bg-black/70 backdrop-blur-xl shadow-[0_0_60px_-15px_rgba(249,115,22,0.5)] p-8",children:h?g?e.jsxs("div",{className:"text-center space-y-4",children:[e.jsx(C,{className:"w-10 h-10 mx-auto text-emerald-400"}),e.jsx("h2",{className:"text-lg font-bold text-white",children:"Password updated"}),e.jsx("p",{className:"text-sm text-white/70",children:"Redirecting you to sign in…"})]}):f?e.jsxs("form",{onSubmit:N,className:"space-y-5",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-white",children:"New password"}),e.jsx(m,{value:r,onChange:t=>w(t.target.value),placeholder:"At least 8 characters",autoComplete:"new-password",wrapperClassName:"mt-2",className:"w-full rounded-lg bg-background border border-border px-4 py-3 text-sm focus:outline-none focus:border-primary"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-white",children:"Confirm password"}),e.jsx(m,{value:d,onChange:t=>b(t.target.value),placeholder:"Re-enter your new password",autoComplete:"new-password",wrapperClassName:"mt-2",className:"w-full rounded-lg bg-background border border-border px-4 py-3 text-sm focus:outline-none focus:border-primary"})]}),e.jsx(S,{type:"submit",disabled:c,className:"btn-gradient w-full rounded-full h-12 text-xs font-bold tracking-wider uppercase",children:c?e.jsx(x,{className:"w-4 h-4 animate-spin"}):"Update password"})]}):e.jsxs("div",{className:"text-center space-y-4",children:[e.jsx("p",{className:"text-sm text-white/70",children:"This reset link is invalid or has expired. Request a new one to continue."}),e.jsx(k,{to:"/forgot-password",className:"inline-block btn-gradient rounded-full px-6 py-3 text-xs font-bold tracking-wider uppercase",children:"Request new link"})]}):e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(x,{className:"w-6 h-6 animate-spin text-orange-400"})})})]})})}export{D 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.