Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds an initial login state in development mode so people do not have…
… to force a mock login
- Loading branch information
Showing
3 changed files
with
43 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,27 @@ | ||
import { createStore } from 'redux' | ||
import reducer from './reducers/index' | ||
import Config from './Config' | ||
|
||
const store = createStore(reducer) | ||
let initialState = {} | ||
if(process.env.NODE_ENV === "development") { | ||
initialState = { | ||
authenticate: { | ||
loginJwt: { | ||
id_token: Config.awsCognitoIdToken, | ||
access_token: Config.awsCognitoAccessToken, | ||
username: 'test-user', | ||
isAuthenticated: true, | ||
expiry: 5555555555555 | ||
}} | ||
} | ||
} | ||
|
||
const store = createStore(reducer, initialState) | ||
|
||
// To use the redux dev tools chrome extention, replace with: | ||
// const store = createStore(reducer, | ||
// window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()) | ||
// initialState, | ||
// window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__() | ||
// ) | ||
|
||
export default store |