From 85c87fbcfc9643b0a2cbd38d3550f7388b585452 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 600a010..a064e88 100644 --- a/src/container/Gone.js +++ b/src/container/Gone.js @@ -15,15 +15,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