Architecture: How should authentication be shared across multiple Angular ...
Documentation for Sessions
🏗️ Architecture: How should authentication be shared across multiple Angular ...
Date: 2026-02-05
Time: 04:40:22 UTC
Session: editor2-89.11
Agent: angular
Confidence: 95%
Status: ✅ Documented
📋 Decision Context
Question:
How should authentication be shared across multiple Angular apps in the NX monorepo?
Task: Not specified
🎯 Decision Made
Chosen:
Use shared @auth-ui library with AuthService, guards, and components
Options Considered:
- Create separate auth implementations per app
- Use shared @auth-ui library with AuthService, guards, and components
- Use external auth provider (Auth0, Firebase)
- Implement auth in each app using copy-paste
💭 Reasoning
All GoGrab apps (gograb-space, gograb-admin, gograb-dev, gograb-ai) share the same authentication infrastructure via @auth-ui library. This provides: 1) AuthService for login/logout/token management, 2) Guards (strictAuthGuard, loginPageGuard, authGuard) for route protection, 3) Reusable components (LoginComponent, UnauthorizedPageComponent), 4) authInterceptor for JWT token injection. Apps import from @auth-ui and configure in app.config.ts with provideHttpClient(withInterceptors([authInterceptor])). The backend-api handles actual authentication, all apps use proxy to forward /api/* requests.
📁 Files Involved
libs/libs-ui/auth-ui/src/index.tsapps/gograb-admin/src/app/app.config.tsapps/gograb-dev/src/app/app.config.tsapps/gograb-space/src/app/app.config.ts
🔗 Related
- Decision ID:
dev_1770266422584_zdaew34 - Session: 89
- Workspace: editor2
Auto-generated by MCP Smart Consolidation