PageSourceSearch

https://repsshield.com/assets/ResetPasswordPage-DEjSjSDc.js

js repsshield.com collected 2026-10-02 02:01:17 UTC 5,279 bytes, 1 lines download raw bytes

1import{am as z,j as s,P as O,ar as D,C as x,b as w,h as H,c as u,d as j,B as e,R as f,ao as N,V as g,av as V,aw as y,ax as P,ay as v,az as b,N as S,ap as k,aq as C,aA as L,as as Y,at as R}from"./index-DGo-vssZ.js";import{u as J,r as a,L as o}from"./vendor-Qgthw7N1.js";const M=Y({password:R().min(6,"Password must be at least 6 characters"),confirmPassword:R().min(6,"Password must be at least 6 characters")}).refine(r=>r.password===r.confirmPassword,{message:"Passwords don't match",path:["confirmPassword"]});function Q(){J();const[r,p]=a.useState(!1),[E,F]=a.useState(!1),[c,t]=a.useState(""),[d,I]=a.useState(!1),[m,T]=a.useState(!1),n=new URLSearchParams(window.location.search).get("token"),i=z({resolver:D(M),defaultValues:{password:"",confirmPassword:""}});a.useEffect(()=>{n||t("Invalid or missing reset token. Please request a new password reset.")},[n]);const B=async l=>{if(!n){t("Invalid reset token");return}p(!0),t("");try{const h=await fetch("/api/auth/reset-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:n,password:l.password})});if(h.ok)F(!0);else{const A=await h.json();t(A.message||"Failed to reset password. Please try again.")}}catch{t("Network error. Please check your connection and try again.")}finally{p(!1)}},q=()=>E?s.jsx("div",{className:"min-h-screen flex items-center justify-center p-4",children:s.jsxs(x,{className:"w-full max-w-md",children:[s.jsxs(w,{className:"text-center",children:[s.jsx("div",{className:"flex justify-center mb-4",children:s.jsx("div",{className:"w-16 h-16 bg-green-100 rounded-full flex items-center justify-center",children:s.jsx(H,{className:"w-8 h-8 text-green-600"})})}),s.jsx(u,{className:"text-2xl font-bold text-green-700",children:"Password Reset Successfully!"}),s.jsx("p",{className:"text-gray-600",children:"Your password has been reset. You can now log in with your new password."})]}),s.jsx(j,{className:"space-y-4",children:s.jsx("div",{className:"text-center",children:s.jsx(o,{href:"/login",children:s.jsx(e,{className:"w-full",children:"Continue to Login"})})})})]})}):!n||c.includes("Invalid or missing reset token")?s.jsx("div",{className:"min-h-screen flex items-center justify-center p-4",children:s.jsxs(x,{className:"w-full max-w-md",children:[s.jsxs(w,{className:"text-center",children:[s.jsx("div",{className:"flex justify-center mb-4",children:s.jsx("img",{src:"/repsshield-logo-main.png",alt:"REPSShield Logo",className:"h-16 w-auto"})}),s.jsx(u,{className:"text-2xl font-bold",children:"Invalid Reset Link"}),s.jsx("p",{className:"text-gray-600",children:"This password reset link is invalid or has expired."})]}),s.jsxs(j,{className:"space-y-6",children:[s.jsxs(f,{variant:"destructive",children:[s.jsx(N,{className:"h-4 w-4"}),s.jsx(g,{children:"The password reset link you clicked is invalid or has expired. Please request a new password reset to continue."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(o,{href:"/forgot-password",children:s.jsx(e,{className:"w-full",children:"Request New Reset Link"})}),s.jsx(o,{href:"/login",children:s.jsx(e,{variant:"outline",className:"w-full",children:"Back to Login"})})]})]})]})}):s.jsx("div",{className:"min-h-screen flex items-center justify-center p-4",children:s.jsxs(x,{className:"w-full max-w-md",children:[s.jsxs(w,{className:"text-center",children:[s.jsx("div",{className:"flex justify-center mb-4",children:s.jsx("img",{src:"/repsshield-logo-main.png",alt:"REPSShield Logo",className:"h-16 w-auto"})}),s.jsx(u,{className:"text-2xl font-bold",children:"Set New Password"}),s.jsx("p",{className:"text-gray-600",children:"Please enter your new password below."})]}),s.jsxs(j,{className:"space-y-6",children:[c&&s.jsxs(f,{variant:"destructive",children:[s.jsx(N,{className:"h-4 w-4"}),s.jsx(g,{children:c})]}),s.jsx(V,{...i,children:s.jsxs("form",{onSubmit:i.handleSubmit(B),className:"space-y-4",children:[s.jsx(y,{control:i.control,name:"password",render:({field:l})=>s.jsxs(P,{children:[s.jsx(v,{children:"New Password"}),s.jsx(b,{children:s.jsxs("div",{className:"relative",children:[s.jsx(S,{type:d?"text":"password",placeholder:"Enter new password",...l}),s.jsx(e,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>I(!d),children:d?s.jsx(k,{className:"h-4 w-4"}):s.jsx(C,{className:"h-4 w-4"})})]})}),s.jsx(L,{})]})}),s.jsx(y,{control:i.control,name:"confirmPassword",render:({field:l})=>s.jsxs(P,{children:[s.jsx(v,{children:"Confirm New Password"}),s.jsx(b,{children:s.jsxs("div",{className:"relative",children:[s.jsx(S,{type:m?"text":"password",placeholder:"Confirm new password",...l}),s.jsx(e,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>T(!m),children:m?s.jsx(k,{className:"h-4 w-4"}):s.jsx(C,{className:"h-4 w-4"})})]})}),s.jsx(L,{})]})}),s.jsx(e,{type:"submit",className:"w-full",disabled:r,children:r?"Resetting Password...":"Reset Password"})]})}),s.jsx("div",{className:"text-center",children:s.jsx(o,{href:"/login",children:s.jsx(e,{variant:"link",className:"text-sm",children:"Back to Login"})})})]})]})});return s.jsx(O,{hideHeader:!0,hideEmailIntake:!0,hideFooter:!0,children:q()})}export{Q as default};

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.