Skip to content

Instantly share code, notes, and snippets.

@kmikulski
Created June 7, 2018 17:42
Show Gist options
  • Select an option

  • Save kmikulski/e307b81f96ec89b47c63d9a51c92aaaa to your computer and use it in GitHub Desktop.

Select an option

Save kmikulski/e307b81f96ec89b47c63d9a51c92aaaa to your computer and use it in GitHub Desktop.
the description for this gist
import React, { Component } from 'react';
import { withRouter } from 'react-router-dom'
class Logout extends Component {
logout() {
this.props.history.push('/');
this.props.keycloak.logout();
}
render() {
return (
<button onClick={ () => this.logout() }>
Logout
</button>
);
}
}
export default withRouter(Logout);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment