Added impersonation. More data available via auth service about the user. Added admin auth guard.
This commit is contained in:
@ -3,22 +3,28 @@ import { RouterModule } from '@angular/router';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { HermesClientService } from '../hermes-client.service';
|
||||
import { ApiAuthenticationService } from '../shared/services/api/api-authentication.service';
|
||||
import { ImpersonationComponent } from '../impersonation/impersonation.component';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
|
||||
@Component({
|
||||
selector: 'navigation',
|
||||
standalone: true,
|
||||
imports: [CommonModule, RouterModule],
|
||||
imports: [CommonModule, RouterModule, ImpersonationComponent, MatCardModule],
|
||||
templateUrl: './navigation.component.html',
|
||||
styleUrl: './navigation.component.scss'
|
||||
})
|
||||
export class NavigationComponent {
|
||||
constructor(private auth: ApiAuthenticationService, private hermes: HermesClientService) { }
|
||||
|
||||
get twitch_logged_in() {
|
||||
isLoggedIn() {
|
||||
return this.auth.isAuthenticated();
|
||||
}
|
||||
|
||||
get tts_logged_in() {
|
||||
isAdmin() {
|
||||
return this.isLoggedIn() && this.auth.isAdmin()
|
||||
}
|
||||
|
||||
isTTSLoggedIn() {
|
||||
return this.hermes?.logged_in ?? false;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user