diff --git a/client/src/pages/Account/index.jsx b/client/src/pages/Account/index.jsx index 0677297..3504806 100644 --- a/client/src/pages/Account/index.jsx +++ b/client/src/pages/Account/index.jsx @@ -2,6 +2,7 @@ import React from "react"; import { Container } from "reactstrap"; import PasswordChangeForm from "../../components/PasswordChangeForm"; import PasswordForgetForm from "../../components/PasswordForgetForm"; +import { useFirebase } from "../../services/auth"; const styles = { root: { @@ -11,6 +12,8 @@ const styles = { }; const AccountPage = () => { + const auth = useFirebase(); + return (

Account

diff --git a/client/src/routes/PrivateRoute.jsx b/client/src/routes/PrivateRoute.jsx index afeca3a..2b278c8 100644 --- a/client/src/routes/PrivateRoute.jsx +++ b/client/src/routes/PrivateRoute.jsx @@ -11,18 +11,19 @@ const PrivateRoute = ({ ...rest }) => { const firebase = useFirebase(); - let render; + let render = null; useEffect(() => { firebase.auth.onAuthStateChanged((authUser) => { if (!condition(authUser)) { history.push(ROUTES.SIGN_IN); } else { - render = condition(authUser) - ? (props) => - : null; + // render = condition(authUser) + // ? (props) => + // : null; } }); }, [firebase.auth, condition, history]); + render = (props) => ; return ; };