Completly reset all auth state on header logo click

This commit is contained in:
SleepWalker
2017-02-01 08:25:15 +02:00
parent a1c713236a
commit cfcfe39bb7
2 changed files with 16 additions and 4 deletions

View File

@@ -31,7 +31,7 @@ function RootPage(props) {
})}>
<div className={styles.header}>
<div className={styles.headerContent}>
<Link to="/" className={styles.logo} onClick={props.resetOAuth}>
<Link to="/" className={styles.logo} onClick={props.resetAuth}>
<Message {...messages.siteName} />
</Link>
<div className={styles.userbar}>
@@ -57,16 +57,16 @@ RootPage.propTypes = {
pathname: PropTypes.string
}).isRequired,
children: PropTypes.element,
resetOAuth: PropTypes.func.isRequired,
resetAuth: PropTypes.func.isRequired,
isPopupActive: PropTypes.bool.isRequired
};
import { connect } from 'react-redux';
import { resetOAuth } from 'components/auth/actions';
import { resetAuth } from 'components/auth/actions';
export default connect((state) => ({
user: state.user,
isPopupActive: state.popup.popups.length > 0
}), {
resetOAuth
resetAuth
})(RootPage);