From 7dfbe0f363a434cfda5f9be996d194f03c36879c Mon Sep 17 00:00:00 2001 From: Biswakalyan Bhuyan Date: Wed, 31 Jul 2024 12:16:49 +0530 Subject: new project --- panel/src/pages/ResetPage.jsx | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 panel/src/pages/ResetPage.jsx (limited to 'panel/src/pages/ResetPage.jsx') diff --git a/panel/src/pages/ResetPage.jsx b/panel/src/pages/ResetPage.jsx new file mode 100644 index 0000000..c1750dc --- /dev/null +++ b/panel/src/pages/ResetPage.jsx @@ -0,0 +1,41 @@ + +import React, { useState } from 'react'; +import { sendPasswordResetEmail } from 'firebase/auth'; +import { auth } from '../firebase'; + +const ResetPage = () => { + const [email, setEmail] = useState(''); + const [message, setMessage] = useState(''); + const [error, setError] = useState(''); + + const handleReset = async () => { + try { + await sendPasswordResetEmail(auth, email); + setMessage('Reset link sent to your email'); + } catch (error) { + setError(error.message); + } + }; + + return ( +
+
+

Reset Password

+
+ + setEmail(e.target.value)} + className="form-control" + /> +
+ {error &&

{error}

} + {message &&

{message}

} + +
+
+ ); +}; + +export default ResetPage; -- cgit v1.2.3-59-g8ed1b