1import{e as b,u as f,r as a,j as e,L as d,B as j,v}from"./index-_aijvlUq.js";import{I as c}from"./Input-ysTyZFq5.js";function P(){const[m]=b(),o=m.get("token"),x=f(),[t,u]=a.useState(""),[r,h]=a.useState(""),[l,n]=a.useState(null),[w,i]=a.useState(!1);if(!o)return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 px-4",children:e.jsxs("div",{className:"w-full max-w-sm text-center",children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Invalid Link"}),e.jsx("p",{className:"text-sm text-gray-500 mb-4",children:"This password reset link is invalid or missing a token."}),e.jsx(d,{to:"/forgot-password",className:"text-sm text-band-600 hover:text-band-700 font-medium",children:"Request a new reset link"})]})});async function p(s){if(s.preventDefault(),n(null),t!==r){n("Passwords do not match");return}i(!0);try{await v.post("/auth/reset-password",{token:o,newPassword:t}),x("/login",{replace:!0})}catch(g){n(g.message)}i(!1)}return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 px-4",children:e.jsxs("div",{className:"w-full max-w-sm",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("img",{src:"/app/brand/logo-primary.svg",alt:"Backstage Baton",className:"h-20 mx-auto mb-4 object-contain"}),e.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Set New Password"}),e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Enter your new password below."})]}),e.jsxs("form",{onSubmit:p,className:"bg-white rounded-xl shadow-sm border border-gray-200 p-6 space-y-4",children:[l&&e.jsx("div",{className:"rounded-md bg-red-50 border border-red-200 px-3 py-2 text-sm text-red-700",children:l}),e.jsx(c,{label:"New Password",type:"password",value:t,onChange:s=>u(s.target.value),required:!0,minLength:8,autoComplete:"new-password",autoFocus:!0}),e.jsx(c,{label:"Confirm Password",type:"password",value:r,onChange:s=>h(s.target.value),required:!0,minLength:8,autoComplete:"new-password"}),e.jsx(j,{type:"submit",isLoading:w,disabled:!t||!r,className:"w-full",children:"Reset password"}),e.jsx("div",{className:"text-center",children:e.jsx(d,{to:"/login",className:"text-sm text-band-600 hover:text-band-700 font-medium",children:"Back to Sign In"})})]})]})})}export{P as ResetPasswordPage};
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.