Logout button

This commit is contained in:
navaneeth 2021-04-29 21:09:32 +05:30
parent 9f742dba64
commit c0f7ec97f3
2 changed files with 14 additions and 2 deletions

View file

@ -29,6 +29,11 @@ class HomePage extends React.Component {
});
}
logout() {
authenticationService.logout();
history.push('/login');
}
render() {
const { currentUser, users, apps, isLoading } = this.state;
return (
@ -73,7 +78,8 @@ class HomePage extends React.Component {
<div className="nav-item dropdown">
<a href="#" className="nav-link d-flex lh-1 text-reset p-0" data-bs-toggle="dropdown" aria-label="Open user menu">
<div className="d-none d-xl-block ps-2">
<div>{this.state.currentUser.first_name}</div>
{/* <div>{this.state.currentUser.first_name}</div> */}
<span onClick={this.logout}>Logout</span>
</div>
</a>
<div className="dropdown-menu dropdown-menu-end dropdown-menu-arrow">

View file

@ -70,6 +70,11 @@ class ManageOrgUsers extends React.Component {
});
}
logout() {
authenticationService.logout();
history.push('/login');
}
render() {
const { isLoading, showNewUserForm, creatingUser, users, newUser, idChangingRole } = this.state;
@ -114,7 +119,8 @@ class ManageOrgUsers extends React.Component {
<div className="nav-item dropdown">
<a href="#" className="nav-link d-flex lh-1 text-reset p-0" data-bs-toggle="dropdown" aria-label="Open user menu">
<div className="d-none d-xl-block ps-2">
<div>{this.state.currentUser.first_name}</div>
{/* <div>{this.state.currentUser.first_name}</div> */}
<span onClick={this.logout}>Logout</span>
</div>
</a>
<div className="dropdown-menu dropdown-menu-end dropdown-menu-arrow">