-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ec8cf57
commit 4baf0c5
Showing
12 changed files
with
286 additions
and
851 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
import React, { useState } from "react"; | ||
import { useNavigate } from "react-router-dom"; | ||
import { toast } from "react-toastify"; | ||
import { sendPasswordResetEmail } from "firebase/auth"; | ||
import { | ||
NewContainer, | ||
FormContainer, | ||
|
@@ -14,43 +16,57 @@ import { | |
} from "./ForgotPasswordelements"; | ||
import ForgotImg from "../../images/Forgotpassword.webp"; | ||
import Footer from "../Footer"; | ||
import { auth } from "../../firebase-config"; // Import your Firebase authentication instance | ||
|
||
const GetMail = () => { | ||
const navigate = useNavigate(); | ||
const [email, setEmail] = useState(); | ||
const handleContinue = () => { | ||
if (!email) alert("enter email"); | ||
else navigate("/signin/otpverification"); | ||
|
||
const handleContinue = async () => { | ||
try { | ||
if (!email) { | ||
// alert("Please enter your email."); | ||
let errorMessage = "Please enter your email"; | ||
toast.error(errorMessage, { | ||
position: "top-right", | ||
autoClose: 5000, | ||
hideProgressBar: false, | ||
closeOnClick: true, | ||
pauseOnHover: true, | ||
draggable: true, | ||
}); | ||
return; | ||
} | ||
|
||
// Send a password reset email | ||
await sendPasswordResetEmail(auth, email); | ||
|
||
// After sending the email, navigate to the OTP verification page | ||
navigate("/signin/otpverification"); | ||
} catch (error) { | ||
let errorMessage = "Error sending password reset email. Please try again."; | ||
// console.error("Error sending password reset email", error); | ||
// alert("Error sending password reset email. Please try again."); | ||
toast.error(errorMessage, { | ||
position: "top-right", | ||
autoClose: 5000, | ||
hideProgressBar: false, | ||
closeOnClick: true, | ||
pauseOnHover: true, | ||
draggable: true, | ||
}); | ||
} | ||
}; | ||
|
||
return ( | ||
// <> | ||
// <FormWrap className="email-form"> | ||
// <FormContent> | ||
// <Form> | ||
// <FormLabel htmlFor="email">Email</FormLabel> | ||
// <FormInput | ||
// onChange={(e) => setEmail(e.target.value)} | ||
// placeholder="[email protected]" | ||
// type="email" | ||
// id="email" | ||
// require | ||
// /> | ||
// <FormButton onClick={handleContinue}>Continue</FormButton> | ||
// <br /> | ||
// <FormButton onClick={() => navigate("/signin")}>Cancel</FormButton> | ||
// </Form> | ||
// </FormContent> | ||
// </FormWrap> | ||
// <Footer /> | ||
// </> | ||
<> | ||
<NewContainer> | ||
<FormContainer> | ||
<FPForm> | ||
<FPimg src={ForgotImg} alt="Forgot Password graphic" /> | ||
<FPheading>Forgot Password?</FPheading> | ||
<FPpara> | ||
Don't worry, Enter your email to receive the OTP for verification | ||
Don't worry, enter your email to receive the OTP for verification | ||
and regain access to your account. | ||
</FPpara> | ||
<FPinput | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
4baf0c5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
umatter – ./
umatter-eight.vercel.app
umatter-git-main-monalikapatnaik.vercel.app
umatter-monalikapatnaik.vercel.app