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:

  1. Create separate auth implementations per app
  2. Use shared @auth-ui library with AuthService, guards, and components
  3. Use external auth provider (Auth0, Firebase)
  4. 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


🔗 Related


Auto-generated by MCP Smart Consolidation