expirytime finally working

This commit is contained in:
2021-09-06 18:12:45 +02:00
parent 9478ad27c6
commit fd25f1fcf5
4 changed files with 31 additions and 7 deletions

View File

@ -29,6 +29,7 @@
<span>Nober Grundbesitz GbR Hausverwaltung</span>
<span class="spacer"></span>
<span class="gittagversion">GITTAGVERSION</span>
<span class="gittagversion" *ngIf="authenticated">Läuft aus in {{expiryTime | async }} Sekunden</span>
<a *ngIf="!authenticated" mat-button routerLink="/login">Login</a>
<a *ngIf="authenticated" mat-button routerLink="/logout">Logout</a>
</mat-toolbar>

View File

@ -33,6 +33,10 @@ export class NavigationComponent {
})
}
get expiryTime(): Observable<number> {
return this.tokenService.expiryTime
}
ngOnInit() {
this.authenticated = this.tokenService.checkAuthenticated()
}