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/coreAPI-Zugriff, Store, Interceptor, Basismodule, Login-Flowsrc/lib/ui/routingroutingnahe Auth-Guardssrc/lib/ui/authorizationAuthorization-Direktiven und Regeltypensrc/lib/ui/passwordPassword-Login-API, Komponente, Optionensrc/lib/ui/oauthOAuth-API, Komponente, Optionen
Architekturgrenzen
- darf
@mmm/auth-contractsverwenden - darf keine NestJS- oder Prisma-spezifischen Implementierungen enthalten
- Authorization baut auf
coreauf, nicht umgekehrt
Öffentliche API
AuthUiModuleAuthFrontendModuleals KompatibilitätsaliasAuthApiAuthStoreAuthGuardCanDirectiveAuthPasswordApiPasswordLoginComponentAuthOAuthApiOAuthLoginComponent
Beispiel
import { AuthUiModule } from "@mmm/auth/ui";
AuthUiModule.forRoot({ core: { apiBaseUrl: "/api", tokenStorage: "sessionStorage", }, password: { loginEndpoint: "/auth/login", postLoginRedirectUrl: "/", }, oauth: { enabledProviders: ["microsoft"], },});Build
pnpm --dir frontend run build