diff options
author | Biswakalyan Bhuyan <biswa@surgot.in> | 2024-08-01 17:35:27 +0530 |
---|---|---|
committer | Biswakalyan Bhuyan <biswa@surgot.in> | 2024-08-01 17:35:27 +0530 |
commit | fb04271b5288e8fb5891b7d6326f4806d12b82d5 (patch) | |
tree | e459c3e1f8bb6e168becdddd0d48779135d91a7f /panel/src/pages/ResetPage.jsx | |
parent | 4bb13ee84f6bb51cba6544ccd0690ab2049512a9 (diff) | |
parent | b3c07fd9f1664dda4f16357aaca74dff8226401d (diff) | |
download | admin-panel-fb04271b5288e8fb5891b7d6326f4806d12b82d5.tar.gz admin-panel-fb04271b5288e8fb5891b7d6326f4806d12b82d5.tar.bz2 admin-panel-fb04271b5288e8fb5891b7d6326f4806d12b82d5.zip |
Merge remote-tracking branch 'project/master'
Diffstat (limited to 'panel/src/pages/ResetPage.jsx')
-rw-r--r-- | panel/src/pages/ResetPage.jsx | 41 |
1 files changed, 41 insertions, 0 deletions
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 ( + <div className="container mx-auto flex items-center justify-center min-h-screen bg-gray-100"> + <div className="bg-white p-6 rounded shadow-md w-full max-w-sm"> + <h4 className="mb-4 text-center">Reset Password</h4> + <div className="mb-4"> + <label>Email</label> + <input + type="email" + value={email} + onChange={(e) => setEmail(e.target.value)} + className="form-control" + /> + </div> + {error && <p className="text-danger">{error}</p>} + {message && <p className="text-success">{message}</p>} + <button onClick={handleReset} className="btn btn-primary w-full">Send Reset Link</button> + </div> + </div> + ); +}; + +export default ResetPage; |