PageSourceSearch

https://rankpilot.dev/assets/index-CiNFaZhq.js

js rankpilot.dev collected 2026-09-24 20:05:38 UTC 2,420 bytes, 1 lines download raw bytes

1import{n as p,u as j,r as n,bK as v,j as s,H as y,v as u,w as b,B as N,x as k,L as S,F as R}from"./index-DrAEDOWO.js";const C=()=>{const c=p(),[x]=j(),[i,h]=n.useState(""),[e,P]=n.useState({newPassword:"",confirmPassword:""}),[o,t]=n.useState(null),[d,m]=n.useState(null),l=v();n.useEffect(()=>{const a=x.get("token");a?h(a):c("/forgot-password")},[]);const w=a=>{o&&t(null),P(r=>({...r,[a.target.name]:a.target.value}))},f=async a=>{if(a.preventDefault(),t(null),m(null),!i){t("This reset link is invalid. Please request a new one.");return}if(e.newPassword.length<8){t("Password must be at least 8 characters long.");return}if(e.newPassword!==e.confirmPassword){t("Passwords do not match.");return}try{const r=await l.mutateAsync({token:i,newPassword:e.newPassword,confirmPassword:e.confirmPassword});m(r.message||"Password reset successfully."),setTimeout(()=>c("/login"),1200)}catch(r){const g=r instanceof R?r.message:"Unable to reset password. Please try again.";t(g)}};return s.jsxs("main",{className:"relative flex min-h-dvh items-center justify-center",children:[s.jsx(y,{children:s.jsx("title",{children:"Reset Password | Rankpilot"})}),s.jsxs("div",{className:"flex w-full max-w-md flex-col items-center space-y-8 px-6 py-20 md:py-10",children:[s.jsx("h2",{className:"text-center text-3xl font-extrabold",children:"Reset Password"}),s.jsxs("form",{onSubmit:f,className:"w-full space-y-6",children:[s.jsxs("div",{className:"spacee-y-2",children:[s.jsx("label",{htmlFor:"newPassword",className:"block text-sm font-medium text-gray-700",children:"New Password"}),s.jsx(u,{id:"newPassword",name:"newPassword",placeholder:"Enter new password",value:e.newPassword,onChange:w,required:!0})]}),s.jsxs("div",{className:"spacee-y-2",children:[s.jsx("label",{htmlFor:"confirmPassword",className:"block text-sm font-medium text-gray-700",children:"Confirm Password"}),s.jsx(u,{id:"confirmPassword",name:"confirmPassword",placeholder:"Confirm new password",value:e.confirmPassword,onChange:w,required:!0})]}),(o||d)&&s.jsx(b,{variant:o?"error":"success",children:o||d}),s.jsx(N,{type:"submit",className:"w-full",disabled:l.isPending,children:l.isPending?s.jsx(k,{className:"size-5 border-white"}):"Reset Password"})]}),s.jsx("div",{className:"text-center text-sm text-gray-600",children:s.jsx(S,{to:"/login",className:"font-medium text-blue hover:underline",children:"Back to Login"})})]})]})};export{C as ResetPassword};

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.