%PDF- %PDF-
Direktori : /home/emergentqj/actioncivile/pre-auth/def/static/js/components/ |
Current File : /home/emergentqj/actioncivile/pre-auth/def/static/js/components/ResetPassword.jsx |
import React, { useEffect } from "react"; import PropTypes, { func } from "prop-types"; import ForgotPasswordContainer from "containers/ForgotPassword/ForgotPasswordContainer"; function ResetPassword({ resetPasswordWithToken, checkToken, }) { useEffect(() => { const urlParams = new URLSearchParams(window.location.search); const token = urlParams.get("token"); if (token) { resetPasswordWithToken(token); checkToken(token); } // Otherwise it goes to the forgot password page }, []); // eslint-disable-line react-hooks/exhaustive-deps return <ForgotPasswordContainer />; } ResetPassword.propTypes = { resetPasswordWithToken: func.isRequired, checkToken: PropTypes.func.isRequired, }; export default ResetPassword;