diff --git a/frontend/src/components/Auth/PasswordResetForm.tsx b/frontend/src/components/Auth/PasswordResetForm.tsx index 39c9d42..9931abc 100644 --- a/frontend/src/components/Auth/PasswordResetForm.tsx +++ b/frontend/src/components/Auth/PasswordResetForm.tsx @@ -15,9 +15,10 @@ interface ResetPasswordErrors { interface SubmitProps { onSubmit: () => void; + token: string; } -const PasswordResetForm: React.FC = ({ onSubmit }) => { +const PasswordResetForm: React.FC = ({ onSubmit, token }) => { const [errors, setErrors] = useState({}); @@ -63,7 +64,7 @@ const PasswordResetForm: React.FC = ({ onSubmit }) => { if (validateResetForm()) { try { - const response = await fetch("/user/reset_password//", { + const response = await fetch("/user/reset_password/ { - const doNothing = (): void => {}; + const { token } = useParams<{ token: string }>(); + const navigate = useNavigate(); - return ( -
-

Forgot Password

- -
- ); + // If the token is missing, handle the error (e.g., redirect or show a message) + if (!token) { + return ( +
+

Invalid Token

+

The reset token is missing or invalid.

+ +
+ ); + } + + const handlePasswordReset = () => { + + }; + + return ( +
+

Forgot Password

+ +
+ ); }; export default ForgotPasswordPage;