-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Bug fix for #77 - Users will now be warned if their tokens are about to expire - Users will be logged out upon token expiration * Update from toast to alert for expired token * Replace interval with timer * Enhance warning * Fix linting * Fix takeUntilDestroyed https://stackoverflow.com/questions/76264067/takeuntildestroyed-can-only-be-used-within-an-injection-context --------- Co-authored-by: Samuel Lim <[email protected]>
- Loading branch information
1 parent
a3e960e
commit de92e85
Showing
3 changed files
with
59 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<main> | ||
<app-navigation-bar /> | ||
<p-toast></p-toast> | ||
<router-outlet /> | ||
</main> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,24 @@ | ||
import { Component } from '@angular/core'; | ||
import { Component, OnInit } from '@angular/core'; | ||
import { RouterOutlet } from '@angular/router'; | ||
import { ButtonModule } from 'primeng/button'; | ||
import { PasswordModule } from 'primeng/password'; | ||
import { ToastModule } from 'primeng/toast'; | ||
import { NavigationBarComponent } from './navigation-bar/navigation-bar.component'; | ||
|
||
import { AuthenticationService } from '../_services/authentication.service'; | ||
import { MessageService } from 'primeng/api'; | ||
@Component({ | ||
selector: 'app-root', | ||
standalone: true, | ||
imports: [NavigationBarComponent, RouterOutlet, ButtonModule, PasswordModule], | ||
imports: [NavigationBarComponent, RouterOutlet, ButtonModule, PasswordModule, ToastModule], | ||
providers: [MessageService], | ||
templateUrl: './app.component.html', | ||
styleUrl: './app.component.css', | ||
}) | ||
export class AppComponent { | ||
export class AppComponent implements OnInit { | ||
title = 'frontend'; | ||
|
||
constructor(private authService: AuthenticationService) {} | ||
ngOnInit() { | ||
this.authService.startTokenExpiryCheck(); | ||
} | ||
} |