PageSourceSearch

https://pleasantoncateringcompany.com/assets/reset-password-CWlSLEz2.js

js pleasantoncateringcompany.com collected 2026-09-29 11:07:08 UTC 2,595 bytes, 1 lines download raw bytes

1import{a as y,r as t,s as o,j as e,L as j}from"./index-B5Aoxc7f.js";import{L as N}from"./loader-circle-BavV0jUT.js";function k(){const m=y(),[p,i]=t.useState(!1),[a,f]=t.useState(""),[d,x]=t.useState(""),[u,l]=t.useState(!1),[c,n]=t.useState(null),[g,b]=t.useState(!1);t.useEffect(()=>{const{data:s}=o.auth.onAuthStateChange((r,w)=>{(r==="PASSWORD_RECOVERY"||w)&&i(!0)});return o.auth.getSession().then(({data:{session:r}})=>{r&&i(!0)}),()=>s.subscription.unsubscribe()},[]);const h=async s=>{if(s.preventDefault(),n(null),a!==d){n("Passwords don't match.");return}l(!0);const{error:r}=await o.auth.updateUser({password:a});if(l(!1),r){n(r.message);return}b(!0),setTimeout(()=>m({to:"/admin"}),1500)};return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-secondary/40 px-4",children:e.jsxs("div",{className:"w-full max-w-md bg-card border border-border rounded-2xl p-8 shadow-[var(--shadow-soft)]",children:[e.jsx(j,{to:"/admin/login",className:"text-sm text-muted-foreground hover:text-foreground",children:"← Back to login"}),e.jsx("h1",{className:"mt-4 font-display text-3xl font-semibold",children:"Set a new password"}),g?e.jsx("p",{className:"mt-4 text-sm text-primary",children:"Password updated. Redirecting…"}):p?e.jsxs("form",{onSubmit:h,className:"mt-6 space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"New password"}),e.jsx("input",{type:"password",required:!0,minLength:8,value:a,onChange:s=>f(s.target.value),className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary/30"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"Confirm new password"}),e.jsx("input",{type:"password",required:!0,minLength:8,value:d,onChange:s=>x(s.target.value),className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary/30"})]}),c&&e.jsx("p",{className:"text-sm text-destructive",children:c}),e.jsxs("button",{type:"submit",disabled:u,className:"w-full inline-flex items-center justify-center gap-2 rounded-lg bg-foreground text-background py-2.5 text-sm font-semibold hover:opacity-90 disabled:opacity-50",children:[u&&e.jsx(N,{className:"h-4 w-4 animate-spin"}),"Update password"]})]}):e.jsx("p",{className:"mt-4 text-sm text-muted-foreground",children:"Open this page from the password reset link in your email. If you got here by mistake, request a new link from the login page."})]})})}export{k 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.