From 625578f56d7da53d7349d77c2f053e0639929e78 Mon Sep 17 00:00:00 2001 From: britea Date: Thu, 5 Mar 2020 11:02:33 +0100 Subject: [PATCH] added pages to reset password --- smart-hut/src/App.js | 34 ++++++++-------------------------- smart-hut/src/views/Signup.js | 2 ++ 2 files changed, 10 insertions(+), 26 deletions(-) diff --git a/smart-hut/src/App.js b/smart-hut/src/App.js index fd6ccee..530ffcb 100644 --- a/smart-hut/src/App.js +++ b/smart-hut/src/App.js @@ -4,34 +4,11 @@ import Home from "./views/Home"; import Dashboard from "./views/DashboardTest"; import Signup from "./views/Signup"; import Login from "./views/Login"; +import ForgotPass from "./views/Forgot-password"; +import ChangePass from "./views/Forgot-pass-reset"; import { call } from './client_server'; - -/*const ProtectedRoute = ({ component: Comp, loggedIn, logOut, path, ...rest }) => { - return ( - { - return loggedIn ? ( - - ) : ( - - ); - }} - /> - ); -};*/ - class App extends React.Component { constructor(props) { super(props); @@ -101,7 +78,12 @@ class App extends React.Component { {this.state.loggedIn ? : } - + + + + + + ); } diff --git a/smart-hut/src/views/Signup.js b/smart-hut/src/views/Signup.js index 503683b..9c301aa 100644 --- a/smart-hut/src/views/Signup.js +++ b/smart-hut/src/views/Signup.js @@ -31,6 +31,8 @@ export default class Signup extends Component{ if (res.status === "Errore") { this.setState({error: { state: true, message: "Errore"}}); + } else if (res.status === 200 && res.data){ + this.props.history.push("/"); } }).catch(err => { //console.log(err);