Implement authentication feature with role-based access control and login dialog
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { AuthService } from './../auth.service';
|
||||
import { Component, inject, computed, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-navbar',
|
||||
@@ -11,4 +12,12 @@ export class NavbarComponent {
|
||||
{label: 'Programm', path: '/schedule'},
|
||||
{label: 'Film importieren', path: '/admin/movie-importer'},
|
||||
]
|
||||
|
||||
private auth = inject(AuthService)
|
||||
|
||||
currentUser = computed(() => this.auth.user());
|
||||
|
||||
logout() {
|
||||
this.auth.logout();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user