@nauth-toolkit/client 0.1.47 → 0.1.49
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.
package/dist/angular/index.cjs
CHANGED
|
@@ -1374,7 +1374,8 @@ var AuthService = class {
|
|
|
1374
1374
|
* Note: AngularHttpAdapter is automatically injected via Angular DI.
|
|
1375
1375
|
* This ensures all requests go through Angular's HttpClient and interceptors.
|
|
1376
1376
|
*/
|
|
1377
|
-
constructor(config) {
|
|
1377
|
+
constructor(config, injector) {
|
|
1378
|
+
this.injector = injector;
|
|
1378
1379
|
__publicField(this, "client");
|
|
1379
1380
|
__publicField(this, "config");
|
|
1380
1381
|
__publicField(this, "currentUserSubject", new import_rxjs2.BehaviorSubject(null));
|
|
@@ -1386,7 +1387,12 @@ var AuthService = class {
|
|
|
1386
1387
|
throw new Error("NAUTH_CLIENT_CONFIG is required to initialize AuthService");
|
|
1387
1388
|
}
|
|
1388
1389
|
this.config = config;
|
|
1389
|
-
const httpAdapter = config.httpAdapter ?? (
|
|
1390
|
+
const httpAdapter = config.httpAdapter ?? this.injector?.get(AngularHttpAdapter, null) ?? null;
|
|
1391
|
+
if (!httpAdapter) {
|
|
1392
|
+
throw new Error(
|
|
1393
|
+
"AngularHttpAdapter is required. Ensure AngularHttpAdapter is provided in your module or pass httpAdapter in config."
|
|
1394
|
+
);
|
|
1395
|
+
}
|
|
1390
1396
|
this.client = new NAuthClient({
|
|
1391
1397
|
...config,
|
|
1392
1398
|
httpAdapter,
|