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);