import { useState } from "react"; import axios from "axios"; import Navbar from "./Navbar"; import Footer from "../components/Footer"; const ForgotPassword = () => { const [email, setEmail] = useState(""); const [message, setMessage] = useState(""); const BASE_URL = import.meta.env.VITE_REACT_APP_SECRET; const handleResetPassword = async () => { try { const response = await axios.post(`${BASE_URL}/users/forgotpassword`, { email, }); setMessage(response.data.message); } catch (error) { console.error("Forgot Password Error:", error); setMessage(error.response.data.message); } }; return ( <> Forgot Password setEmail(e.target.value)} placeholder="name@example.com" required="required" /> Enter your email address to receive a password reset link Reset Password {message} Already have an account?{" "} Sign in > ); }; export default ForgotPassword;
{message}
Already have an account?{" "} Sign in