diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-09-16 22:40:05 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-09-16 22:40:05 +0200 |
| commit | d3e4bb3ed2585859a3adeb7eeff35b7c75ebd840 (patch) | |
| tree | e88e9edae5a63328fb1acc625e5624990717d20f /app/client/auth/logout.component.js | |
| parent | 189be96150fbd49766228cf50c6a89279542565c (diff) | |
auth gate on main app. pull in auth routes from bucky.
Diffstat (limited to 'app/client/auth/logout.component.js')
| -rw-r--r-- | app/client/auth/logout.component.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/app/client/auth/logout.component.js b/app/client/auth/logout.component.js new file mode 100644 index 0000000..bcc3bce --- /dev/null +++ b/app/client/auth/logout.component.js @@ -0,0 +1,24 @@ +import { h, Component } from 'preact'; +// import PropTypes from 'prop-types'; +import { bindActionCreators } from 'redux'; +import { connect } from 'react-redux'; +import { Redirect } from 'react-router-dom'; +import * as authActions from './auth.actions'; + +class Logout extends Component { + componentWillMount(props){ + this.props.actions.logout() + } + render(){ + return <Redirect to="/" /> + } +} + +const mapStateToProps = (state) => ({ +}); + +const mapDispatchToProps = (dispatch) => ({ + actions: bindActionCreators(authActions, dispatch) +}); + +export default connect(mapStateToProps, mapDispatchToProps)(Logout); |
