diff --git a/src/pages/index/IndexPage.jsx b/src/pages/index/IndexPage.jsx index 427985f..9ac770e 100644 --- a/src/pages/index/IndexPage.jsx +++ b/src/pages/index/IndexPage.jsx @@ -2,17 +2,9 @@ import React, { Component } from 'react'; import { connect } from 'react-redux'; -import authFlow from 'services/authFlow'; - class IndexPage extends Component { displayName = 'IndexPage'; - componentWillMount() { - if (this.props.user.isGuest) { - authFlow.login(); - } - } - render() { const {user, children} = this.props; diff --git a/src/routes.js b/src/routes.js index 69d5c90..20ddaf6 100644 --- a/src/routes.js +++ b/src/routes.js @@ -34,7 +34,7 @@ export default function routesFactory(store) { return ( - + diff --git a/src/services/authFlow/AuthFlow.js b/src/services/authFlow/AuthFlow.js index c071050..b00da93 100644 --- a/src/services/authFlow/AuthFlow.js +++ b/src/services/authFlow/AuthFlow.js @@ -23,7 +23,6 @@ export default class AuthFlow { const {routing} = this.getState(); if (routing.location.pathname !== route) { - this.ignoreRequest = true; // TODO: remove me if (this.replace) { this.replace(route); } @@ -62,10 +61,10 @@ export default class AuthFlow { throw new Error('State is required'); } - if (this.state instanceof state.constructor) { - // already in this state - return; - } + // if (this.state instanceof state.constructor) { + // // already in this state + // return; + // } this.state && this.state.leave(this); this.state = state; @@ -74,10 +73,6 @@ export default class AuthFlow { handleRequest(path, replace) { this.replace = replace; - if (this.ignoreRequest) { - this.ignoreRequest = false; - return; - } switch (path) { case '/oauth': @@ -92,6 +87,7 @@ export default class AuthFlow { this.setState(new ForgotPasswordState()); break; + case '/': case '/login': case '/password': case '/activation':