feat(auth): Add external authentication (OAuth/OIDC & LDAP) with admin management, UI, and encryption support
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { Component, computed, inject } from '@angular/core';
|
||||
import { RouterOutlet, RouterLink, RouterLinkActive } from '@angular/router';
|
||||
import { AuthService } from '../../../core/services/auth.service';
|
||||
import { ToastService } from '../../../core/services/toast.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-layout',
|
||||
@@ -65,6 +64,20 @@ import { ToastService } from '../../../core/services/toast.service';
|
||||
</svg>
|
||||
Settings
|
||||
</a>
|
||||
|
||||
<!-- Admin Section -->
|
||||
@if (isAdmin()) {
|
||||
<div class="pt-4 mt-4 border-t border-border">
|
||||
<p class="px-3 mb-2 font-mono text-xs text-muted-foreground uppercase tracking-wider">Administration</p>
|
||||
<a routerLink="/admin/auth" routerLinkActive="bg-primary/10 text-primary"
|
||||
class="nav-link">
|
||||
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" />
|
||||
</svg>
|
||||
Authentication
|
||||
</a>
|
||||
</div>
|
||||
}
|
||||
</nav>
|
||||
|
||||
<!-- User section -->
|
||||
@@ -108,6 +121,7 @@ export class LayoutComponent {
|
||||
const name = this.authService.user()?.displayName || 'U';
|
||||
return name.charAt(0).toUpperCase();
|
||||
});
|
||||
isAdmin = computed(() => this.authService.isAdmin());
|
||||
|
||||
logout(): void {
|
||||
this.authService.logout();
|
||||
|
||||
Reference in New Issue
Block a user