Open moalamin opened 7 years ago
Hi @moalamin,
This is normal behaviour. configure()
will dispatch multiple actions independently. This will invoke an attempt to load token headers that have been persisted to cookies (or local storage).
Your configuration cleanSession: true
, does not allow persistence, so the token headers aren't available, causing a failure- as you've noted: AUTHENTICATE_ERROR
. You'll note that you must log in again at this point.
If you change your configuration to cleanSession: false
, the token headers will be persisted, and reloaded next time you run the app, at which point you should see AUTHENTICATE_COMPLETE
, and you should still be logged in.
Hello, my index.js file, the main part of my react application looks like this:
`import React from 'react'; import ReactDOM from 'react-dom'; import App from './App'; import SignUp from './components/SignIn.js' import Todos from './components/Todos.js'; import './index.css'; import { Router, Route, browserHistory, IndexRoute } from 'react-router'; import { syncHistoryWithStore } from 'react-router-redux'; import { Provider } from 'react-redux'; import { configure } from 'redux-auth'; import store from './stores/index.js';
store.dispatch(configure({ apiUrl: 'http://localhost:3000', isServer: false, cleanSession: true, clientOnly: true }))
const history = syncHistoryWithStore(browserHistory, store);
ReactDOM.render(