diff --git a/backend/server.js b/backend/server.js index b72c093d236ee1258380e530a675bc174689b63f..2b5c20996bc0141a00a4a44db3b1df34f98a2dfa 100644 --- a/backend/server.js +++ b/backend/server.js @@ -70,7 +70,8 @@ app.get('/callback', function (req, res) { console.log(access_token); let uri = process.env.FRONTEND_URI || 'http://localhost:3000/' uri= uri + '?access_token=' + access_token - if (!!req.query.state){ + console.log(req.query.state); + if (typeof req.query.state!=="undefined"){ uri=uri+`&from=${req.query.state}` } res.redirect(uri + '?access_token=' + access_token) diff --git a/frontend/src/components/layout/Landing.js b/frontend/src/components/layout/Landing.js index a7183d14e23a7b50b4b68294601df5d3c280e19b..2ae751be11cfbd75b89efc5ba66d69d90c6a5dd3 100644 --- a/frontend/src/components/layout/Landing.js +++ b/frontend/src/components/layout/Landing.js @@ -7,7 +7,6 @@ class Landing extends Component{ componentDidMount(){ if(this.props.auth.isAuthenticated){ - console.log(this.props); this.props.history.push(`/`); } else { const {access_token} = queryString.parse(window.location.search); @@ -16,9 +15,11 @@ class Landing extends Component{ } componentWillReceiveProps(nextProps){ - if(nextProps.auth.isAuthenticated){ - this.props.history.push('/dashboard'); - } + console.log(this.props) + console.log(nextProps) + // if(nextProps.auth.isAuthenticated){ + // this.props.history.push('/dashboard'); + // } } render(){