|
|
|
@ -15,15 +15,15 @@ const Gone = (props) => (
|
|
|
|
|
{props.loggedIn ? 'Logged in': 'Nah anonymous'} |
|
|
|
|
<hr /> |
|
|
|
|
|
|
|
|
|
<button onClick={_ => props.fetchAuth("user", "passwd")}>Login</button> |
|
|
|
|
<button onClick={_ => fetchAuth("user", "passwd")}>Login</button> |
|
|
|
|
</div> |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const mapStateToProps = state => ({ |
|
|
|
|
token: getToken(state.auth) |
|
|
|
|
token: getToken(state.auth), |
|
|
|
|
loggedIn: loggedIn(state.auth), |
|
|
|
|
}) |
|
|
|
|
export default connect( |
|
|
|
|
mapStateToProps, |
|
|
|
|
{ loggedIn, fetchAuth } |
|
|
|
|
mapStateToProps |
|
|
|
|
)(Gone) |
|
|
|
|