Initial commit
This commit is contained in:
20
website/src/Auth/Logout.js
Normal file
20
website/src/Auth/Logout.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import React from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import { api } from '../helpers'
|
||||
|
||||
export class Logout extends React.Component {
|
||||
static propTypes = {
|
||||
history: PropTypes.oneOfType([PropTypes.array, PropTypes.object])
|
||||
}
|
||||
componentDidMount(event) {
|
||||
api.logout().then(() => {
|
||||
if (this.props.history) {
|
||||
this.props.history.push('/')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
return null
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user