mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-11-17 21:53:03 +05:30
#48: reset oauthData on logo click
This commit is contained in:
parent
42c4d3fe58
commit
13b4dcbbe8
@ -231,6 +231,13 @@ export function setClient({id, name, description}) {
|
||||
};
|
||||
}
|
||||
|
||||
export function resetOAuth() {
|
||||
return (dispatch) => {
|
||||
localStorage.removeItem('oauthData');
|
||||
dispatch(setOAuthRequest({}));
|
||||
};
|
||||
}
|
||||
|
||||
export const SET_OAUTH = 'set_oauth';
|
||||
export function setOAuthRequest(oauth) {
|
||||
return {
|
||||
|
@ -31,7 +31,7 @@ function RootPage(props) {
|
||||
})}>
|
||||
<div className={styles.header}>
|
||||
<div className={styles.headerContent}>
|
||||
<Link to="/" className={styles.logo}>
|
||||
<Link to="/" className={styles.logo} onClick={props.resetOAuth}>
|
||||
<Message {...messages.siteName} />
|
||||
</Link>
|
||||
<div className={styles.userbar}>
|
||||
@ -57,12 +57,16 @@ RootPage.propTypes = {
|
||||
pathname: PropTypes.string
|
||||
}).isRequired,
|
||||
children: PropTypes.element,
|
||||
resetOAuth: PropTypes.func.isRequired,
|
||||
isPopupActive: PropTypes.bool.isRequired
|
||||
};
|
||||
|
||||
import { connect } from 'react-redux';
|
||||
import { resetOAuth } from 'components/auth/actions';
|
||||
|
||||
export default connect((state) => ({
|
||||
user: state.user,
|
||||
isPopupActive: state.popup.popups.length > 0
|
||||
}))(RootPage);
|
||||
}), {
|
||||
resetOAuth
|
||||
})(RootPage);
|
||||
|
Loading…
Reference in New Issue
Block a user