expiry display not working
This commit is contained in:
parent
657d85538e
commit
bbe698fc12
@ -28,7 +28,6 @@
|
||||
</button>
|
||||
<span>Nober Grundbesitz GbR Hausverwaltung</span>
|
||||
<span class="spacer"></span>
|
||||
<span class="gittagversion">Expires in: {{expiresIn}} seconds</span>
|
||||
<span class="gittagversion">GITTAGVERSION</span>
|
||||
<a *ngIf="!authenticated" mat-button routerLink="/login">Login</a>
|
||||
<a *ngIf="authenticated" mat-button routerLink="/logout">Logout</a>
|
||||
|
@ -15,7 +15,6 @@ import { NavigationEnd, Router } from '@angular/router';
|
||||
export class NavigationComponent {
|
||||
|
||||
public authenticated: boolean
|
||||
expiresIn: number
|
||||
|
||||
isHandset$: Observable<boolean> = this.breakpointObserver.observe(Breakpoints.Handset)
|
||||
.pipe(
|
||||
@ -36,7 +35,6 @@ export class NavigationComponent {
|
||||
|
||||
ngOnInit() {
|
||||
this.authenticated = this.tokenService.checkAuthenticated()
|
||||
this.expiresIn = 600
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,8 +3,6 @@ import { MessageService } from './message.service';
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import { UserCreds } from './userCreds'
|
||||
import jwt_decode from 'jwt-decode'
|
||||
import { Observable } from 'rxjs';
|
||||
import { ComplexOuterSubscriber } from 'rxjs/internal/innerSubscribe';
|
||||
|
||||
|
||||
|
||||
@ -21,6 +19,7 @@ export class TokenService {
|
||||
public static Id_AuthToken_Key : string = "id_authtoken";
|
||||
public static Id_RefreshToken_Key : string = "id_refreshtoken";
|
||||
|
||||
|
||||
constructor(private http: HttpClient, private messageService: MessageService) {
|
||||
}
|
||||
|
||||
@ -81,23 +80,4 @@ export class TokenService {
|
||||
}
|
||||
}
|
||||
|
||||
expiryUpdate() : Observable<number> {
|
||||
const exUp = new Observable<number>((observer) => {
|
||||
let i = 600
|
||||
|
||||
while (i != 0) {
|
||||
observer.next(i)
|
||||
i -= 1
|
||||
await new Promise(f => setTimeout(f, 1000))
|
||||
}
|
||||
observer.complete()
|
||||
|
||||
return {
|
||||
unsubscribe() {
|
||||
}
|
||||
}
|
||||
})
|
||||
return exUp
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user