diff --git a/src/pages/reset-password/index.jsx b/src/pages/reset-password/index.jsx new file mode 100644 index 0000000..3ef5339 --- /dev/null +++ b/src/pages/reset-password/index.jsx @@ -0,0 +1,58 @@ +import { useState } from "react"; +import { getAuth, sendPasswordResetEmail } from "firebase/auth"; +import { useRouter } from "next/router"; // Import useRouter +import Button from "@/components/button/Button"; + +export default function ResetPasswordForm() { + const [email, setEmail] = useState(""); + const router = useRouter(); // Use useRouter + const auth = getAuth(); + + function handleResetPassword(e) { + e.preventDefault(); + sendPasswordResetEmail(auth, email) + .then(() => { + router.push("/login"); // Use router.push + }) + .catch((error) => { + console.log("Error:", error); + }); + } + + return ( +
+
+

+ Reset Password +

+
+
+ + setEmail(e.target.value)} + required + /> +
+ +
+
+ + Back to Login + +
+
+
+ ); +}