From 8d91012015178777dcbb8eb022acc9b0b665cc0f Mon Sep 17 00:00:00 2001 From: sipp11 Date: Mon, 1 Oct 2018 13:17:05 +0900 Subject: [PATCH] Fix auth bugs --- src/container/Gone.js | 8 ++++---- src/reducers/auth.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/container/Gone.js b/src/container/Gone.js index f08d61d..82deb2e 100644 --- a/src/container/Gone.js +++ b/src/container/Gone.js @@ -19,15 +19,15 @@ const Gone = (props) => ( {props.loggedIn ? 'Logged in': 'Nah anonymous'}
- + ) const mapStateToProps = state => ({ - token: getToken(state.auth) + token: getToken(state.auth), + loggedIn: loggedIn(state.auth), }) export default connect( - mapStateToProps, - { loggedIn, fetchAuth } + mapStateToProps )(Gone) diff --git a/src/reducers/auth.js b/src/reducers/auth.js index 07bc968..e6e6f2c 100644 --- a/src/reducers/auth.js +++ b/src/reducers/auth.js @@ -37,4 +37,4 @@ const token = (state = tokenInitialState, action) => { export default token export const getToken = state => state.token -export const loggedIn = state => state && state.token == null +export const loggedIn = state => state && state.token !== null