Skip to content

auth-ui

@mmm/auth-ui

Angular-UI-Paket der Auth-Domain.

Verantwortung

  • Auth-Basislogik für den Client
  • Routing-nahe Auth-Guards
  • Authorization-nahe Direktiven und Checks
  • Password- und OAuth-spezifische UI-Bausteine

Struktur

  • src/lib/ui/core API-Zugriff, Store, Interceptor, Basismodule, Login-Flow
  • src/lib/ui/routing routingnahe Auth-Guards
  • src/lib/ui/authorization Authorization-Direktiven und Regeltypen
  • src/lib/ui/password Password-Login-API, Komponente, Optionen
  • src/lib/ui/oauth OAuth-API, Komponente, Optionen

Architekturgrenzen

  • darf @mmm/auth-contracts verwenden
  • darf keine NestJS- oder Prisma-spezifischen Implementierungen enthalten
  • Authorization baut auf core auf, nicht umgekehrt

Öffentliche API

  • AuthUiModule
  • AuthFrontendModule als Kompatibilitätsalias
  • AuthApi
  • AuthStore
  • AuthGuard
  • CanDirective
  • AuthPasswordApi
  • PasswordLoginComponent
  • AuthOAuthApi
  • OAuthLoginComponent

Beispiel

import { AuthUiModule } from "@mmm/auth/ui";
AuthUiModule.forRoot({
core: {
apiBaseUrl: "/api",
tokenStorage: "sessionStorage",
},
password: {
loginEndpoint: "/auth/login",
postLoginRedirectUrl: "/",
},
oauth: {
enabledProviders: ["microsoft"],
},
});

Build

Terminal window
pnpm --dir frontend run build