@acontplus/ng-auth 2.4.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +17 -11
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @acontplus/ng-auth
2
2
 
3
- Angular authentication library with comprehensive auth features following Angular 21 best practices and clean architecture principles.
3
+ Angular authentication library with comprehensive auth features following Angular 22 best practices and clean architecture principles.
4
4
 
5
5
  > **🚀 New Feature**: Multi-Tenant OAuth / Enterprise SSO
6
6
  > Support for Google Workspace, Microsoft 365, and Azure AD with automatic domain discovery.
@@ -16,7 +16,7 @@ pnpm add @acontplus/ng-auth
16
16
 
17
17
  ## Features
18
18
 
19
- - ✅ **Modern Angular 21 Patterns**: Signals, inject(), standalone components
19
+ - ✅ **Modern Angular 22 Patterns**: Signals, inject(), standalone components
20
20
  - ✅ **Clean Architecture**: Domain → Data → Services (no use cases overhead)
21
21
  - ✅ **AuthState Service**: Centralized auth state with reactive signals
22
22
  - ✅ **Multi-Tenant OAuth**: Enterprise SSO with domain discovery (Google Workspace, Azure AD)
@@ -50,6 +50,16 @@ import { ApplicationConfig } from '@angular/core';
50
50
  import { provideHttpClient, withInterceptors } from '@angular/common/http';
51
51
  import { authProviders, authRedirectInterceptor, csrfInterceptor } from '@acontplus/ng-auth';
52
52
  import { ENVIRONMENT } from '@acontplus/ng-config';
53
+ import { Environment } from '@acontplus/core';
54
+
55
+ const environment: Environment = {
56
+ isProduction: false,
57
+ apiBaseUrl: 'https://api.example.com',
58
+ clientId: 'my-app',
59
+ tokenKey: 'auth_token',
60
+ refreshTokenKey: 'refresh_token',
61
+ loginRoute: 'auth/login',
62
+ };
53
63
 
54
64
  export const appConfig: ApplicationConfig = {
55
65
  providers: [
@@ -66,11 +76,7 @@ export const appConfig: ApplicationConfig = {
66
76
  // Environment config
67
77
  {
68
78
  provide: ENVIRONMENT,
69
- useValue: {
70
- tokenKey: 'auth_token',
71
- refreshTokenKey: 'refresh_token',
72
- loginRoute: 'auth/login',
73
- },
79
+ useValue: environment,
74
80
  },
75
81
  ],
76
82
  };
@@ -85,7 +91,7 @@ import { authGuard } from '@acontplus/ng-auth';
85
91
 
86
92
  export const routes: Routes = [
87
93
  {
88
- path: 'auth',
94
+ path: 'auth/login',
89
95
  loadComponent: () => import('./pages/auth').then((m) => m.AuthPage),
90
96
  },
91
97
  {
@@ -303,7 +309,7 @@ export class AuthPage {
303
309
 
304
310
  ## Architecture
305
311
 
306
- Following **Angular 21 style guide** and **clean architecture**:
312
+ Following **Angular 22 style guide** and **clean architecture**:
307
313
 
308
314
  ```
309
315
  ng-auth/
@@ -334,7 +340,7 @@ ng-auth/
334
340
  - ✅ AuthState consolidates all auth operations
335
341
  - ✅ Signals for reactive state
336
342
  - ✅ Repository pattern for data abstraction
337
- - ✅ No `.service.ts` suffix (Angular 21 style guide)
343
+ - ✅ No `.service.ts` suffix (Angular 22 style guide)
338
344
 
339
345
  ## Real-World Example
340
346
 
@@ -473,7 +479,7 @@ export class MyComponent {
473
479
  A: For a library, use cases add unnecessary indirection. The `AuthState` service provides a clean facade with all operations.
474
480
 
475
481
  **Q: Can I use constructor injection instead of inject()?**
476
- A: Yes, but `inject()` is the Angular 21 recommended approach.
482
+ A: Yes, but `inject()` is the Angular 22 recommended approach.
477
483
 
478
484
  **Q: How do I customize the login component?**
479
485
  A: Use the component inputs (`additionalSigninControls`, templates) or create your own using `AuthState` directly.
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@acontplus/ng-auth",
3
- "version": "2.4.0",
3
+ "version": "3.0.1",
4
4
  "description": "Comprehensive Angular authentication module with JWT token management, route guards, CSRF protection, URL redirection, session handling, and clean architecture patterns. Includes login components, auth interceptors, and DDD-based repositories.",
5
5
  "peerDependencies": {
6
6
  "@acontplus/core": "^1.1.4",
7
- "@acontplus/ng-infrastructure": "2.3.0",
8
- "@acontplus/ng-config": "2.1.0",
7
+ "@acontplus/ng-infrastructure": "3.1.0",
8
+ "@acontplus/ng-config": "3.0.1",
9
9
  "@acontplus/ui-kit": "^1.0.2",
10
10
  "@angular/common": "^22.1.0",
11
11
  "@angular/core": "^22.1.0",