diff --git a/src/components/auth/actions.js b/src/components/auth/actions.js index 5642904..d9823b3 100644 --- a/src/components/auth/actions.js +++ b/src/components/auth/actions.js @@ -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 { diff --git a/src/pages/root/RootPage.jsx b/src/pages/root/RootPage.jsx index a335f5d..1d2f2a4 100644 --- a/src/pages/root/RootPage.jsx +++ b/src/pages/root/RootPage.jsx @@ -31,7 +31,7 @@ function RootPage(props) { })}>
- +
@@ -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);