Add logout functionality
This commit is contained in:
@@ -18,5 +18,9 @@
|
||||
<mat-icon>ballot</mat-icon>
|
||||
<span>Bot Settings</span>
|
||||
</button>
|
||||
<button mat-menu-item (click)="logout()">
|
||||
<mat-icon>logout</mat-icon>
|
||||
<span>Logout</span>
|
||||
</button>
|
||||
</mat-menu>
|
||||
</mat-toolbar>
|
||||
|
@@ -1,15 +1,19 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { TokenStorageService } from 'src/app/Services/token.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-header',
|
||||
templateUrl: './header.component.html',
|
||||
styleUrls: ['./header.component.scss']
|
||||
styleUrls: ['./header.component.scss'],
|
||||
})
|
||||
export class HeaderComponent implements OnInit {
|
||||
constructor(private tokenStorage: TokenStorageService) {}
|
||||
|
||||
constructor() { }
|
||||
ngOnInit(): void {}
|
||||
|
||||
ngOnInit(): void {
|
||||
logout() {
|
||||
console.log('NASE');
|
||||
this.tokenStorage.signOut();
|
||||
location.reload();
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user