@nauth-toolkit/client-angular 0.1.57 → 0.1.59
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/esm2022/lib/auth.guard.mjs +58 -23
- package/esm2022/lib/social-redirect-callback.guard.mjs +28 -24
- package/esm2022/ngmodule/auth.service.mjs +16 -1
- package/esm2022/ngmodule/http-adapter.mjs +62 -16
- package/esm2022/ngmodule/nauth.module.mjs +4 -1
- package/esm2022/standalone/auth.guard.mjs +32 -13
- package/esm2022/standalone/auth.service.mjs +16 -1
- package/esm2022/standalone/http-adapter.mjs +62 -16
- package/esm2022/standalone/social-redirect-callback.guard.mjs +28 -24
- package/fesm2022/nauth-toolkit-client-angular-standalone.mjs +131 -49
- package/fesm2022/nauth-toolkit-client-angular-standalone.mjs.map +1 -1
- package/fesm2022/nauth-toolkit-client-angular.mjs +218 -118
- package/fesm2022/nauth-toolkit-client-angular.mjs.map +1 -1
- package/lib/auth.guard.d.ts +39 -16
- package/lib/social-redirect-callback.guard.d.ts +2 -2
- package/ngmodule/auth.service.d.ts +13 -0
- package/ngmodule/http-adapter.d.ts +16 -0
- package/package.json +2 -2
- package/standalone/auth.guard.d.ts +13 -6
- package/standalone/auth.service.d.ts +13 -0
- package/standalone/http-adapter.d.ts +16 -0
- package/standalone/social-redirect-callback.guard.d.ts +2 -2
|
@@ -24,6 +24,22 @@ import * as i0 from "@angular/core";
|
|
|
24
24
|
export declare class AngularHttpAdapter implements HttpAdapter {
|
|
25
25
|
private readonly http;
|
|
26
26
|
constructor(http: HttpClient);
|
|
27
|
+
/**
|
|
28
|
+
* Safely parse a JSON response body.
|
|
29
|
+
*
|
|
30
|
+
* Angular's fetch backend (`withFetch()`) will throw a raw `SyntaxError` if
|
|
31
|
+
* `responseType: 'json'` is used and the backend returns HTML (common for
|
|
32
|
+
* proxies, 502 pages, SSR fallbacks, or misrouted requests).
|
|
33
|
+
*
|
|
34
|
+
* To avoid crashing consumer apps, we always request as text and then parse
|
|
35
|
+
* JSON only when the response actually looks like JSON.
|
|
36
|
+
*
|
|
37
|
+
* @param bodyText - Raw response body as text
|
|
38
|
+
* @param contentType - Content-Type header value (if available)
|
|
39
|
+
* @returns Parsed JSON value (unknown)
|
|
40
|
+
* @throws {SyntaxError} When body is non-empty but not valid JSON
|
|
41
|
+
*/
|
|
42
|
+
private parseJsonBody;
|
|
27
43
|
/**
|
|
28
44
|
* Execute HTTP request using Angular's HttpClient.
|
|
29
45
|
*
|
|
@@ -9,8 +9,8 @@ import { type CanActivateFn } from '@angular/router';
|
|
|
9
9
|
* - `error` / `error_description` (provider errors)
|
|
10
10
|
*
|
|
11
11
|
* Behavior:
|
|
12
|
-
* - If `exchangeToken` exists: exchanges it via backend
|
|
13
|
-
* - If no `exchangeToken`: treat as cookie-success path
|
|
12
|
+
* - If `exchangeToken` exists: exchanges it via backend (SDK handles navigation automatically).
|
|
13
|
+
* - If no `exchangeToken`: treat as cookie-success path (SDK handles navigation automatically).
|
|
14
14
|
* - If `error` exists: redirects to oauthError route.
|
|
15
15
|
*
|
|
16
16
|
* @example
|