@asgardeo/auth-react 1.1.1 → 1.1.4
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/main.js +40 -40
- package/dist/src/authenticate.d.ts.map +1 -1
- package/dist/src/models.d.ts +2 -1
- package/dist/src/models.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +53 -51
- package/package.json +2 -2
- package/src/authenticate.tsx +56 -43
- package/src/models.ts +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticate.d.ts","sourceRoot":"","sources":["../../src/authenticate.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;
|
|
1
|
+
{"version":3,"file":"authenticate.d.ts","sourceRoot":"","sources":["../../src/authenticate.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAaH,OAAc,EACV,iBAAiB,EACjB,iBAAiB,EACjB,SAAS,EAMZ,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,UAAU,EAAe,MAAM,GAAG,CAAC;AAC5C,OAAO,OAAO,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAsB,MAAM,UAAU,CAAC;AASrF,QAAA,MAAM,UAAU,SAAgB,CAAC;AAOjC,UAAU,0BAA0B;IAChC,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,0BAA0B,CAAC,CAsLlF,CAAC;AAEF,QAAA,MAAM,cAAc,QAAO,oBAE1B,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC"}
|
package/dist/src/models.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
import { AuthClientConfig, AuthSPAClientConfig, BasicUserInfo, Config, CustomGrantConfig, DecodedIDTokenPayload, FetchResponse, Hooks, HttpClientInstance, HttpRequestConfig, HttpResponse, OIDCEndpoints, SignInConfig } from "@asgardeo/auth-spa";
|
|
18
|
+
import { AsgardeoAuthException, AuthClientConfig, AuthSPAClientConfig, BasicUserInfo, Config, CustomGrantConfig, DecodedIDTokenPayload, FetchResponse, Hooks, HttpClientInstance, HttpRequestConfig, HttpResponse, OIDCEndpoints, SignInConfig } from "@asgardeo/auth-spa";
|
|
19
19
|
export interface ReactConfig {
|
|
20
20
|
/**
|
|
21
21
|
* The SDK's `AuthProvider` by default is listening to the URL changes to see
|
|
@@ -87,6 +87,7 @@ export interface AuthContextInterface {
|
|
|
87
87
|
on(hook: Exclude<Hooks, Hooks.CustomGrant>, callback: (response?: any) => void): void;
|
|
88
88
|
on(hook: Hooks, callback: (response?: any) => void, id?: string): void;
|
|
89
89
|
state: AuthStateInterface;
|
|
90
|
+
error: AsgardeoAuthException;
|
|
90
91
|
}
|
|
91
92
|
export interface SecureRouteInterface {
|
|
92
93
|
callback: () => void;
|
package/dist/src/models.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACH,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,EACb,MAAM,EACN,iBAAiB,EACjB,qBAAqB,EACrB,aAAa,EACb,KAAK,EACL,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,YAAY,EACf,MAAM,oBAAoB,CAAC;AAE5B,MAAM,WAAW,WAAW;IACxB;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B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AAE,CACE,IAAI,EAAE,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,EACvC,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,GAAG,KAAK,IAAI,GACnC,IAAI,CAAC;IACR,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,GAAG,KAAK,IAAI,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvE,KAAK,EAAE,kBAAkB,CAAC;IAC1B,KAAK,EAAE,qBAAqB,CAAC;CAChC;AAED,MAAM,WAAW,oBAAoB;IACjC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,GAAG,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -187,8 +187,8 @@
|
|
|
187
187
|
"affectsGlobalScope": false
|
|
188
188
|
},
|
|
189
189
|
"../../node_modules/@asgardeo/auth-js/dist/src/constants/data.d.ts": {
|
|
190
|
-
"version": "
|
|
191
|
-
"signature": "
|
|
190
|
+
"version": "030074650037a6e61cfb86ae3e22845464535b376736976eaca80d214c9d1286",
|
|
191
|
+
"signature": "030074650037a6e61cfb86ae3e22845464535b376736976eaca80d214c9d1286",
|
|
192
192
|
"affectsGlobalScope": false
|
|
193
193
|
},
|
|
194
194
|
"../../node_modules/@asgardeo/auth-js/dist/src/constants/parameters.d.ts": {
|
|
@@ -217,13 +217,13 @@
|
|
|
217
217
|
"affectsGlobalScope": false
|
|
218
218
|
},
|
|
219
219
|
"../../node_modules/@asgardeo/auth-js/dist/src/models/client-config.d.ts": {
|
|
220
|
-
"version": "
|
|
221
|
-
"signature": "
|
|
220
|
+
"version": "00e3e9ba3acec03d269c27e23b59e45f2e2e43375b770dfda3f1d7edff7d19f1",
|
|
221
|
+
"signature": "00e3e9ba3acec03d269c27e23b59e45f2e2e43375b770dfda3f1d7edff7d19f1",
|
|
222
222
|
"affectsGlobalScope": false
|
|
223
223
|
},
|
|
224
224
|
"../../node_modules/@asgardeo/auth-js/dist/src/models/data.d.ts": {
|
|
225
|
-
"version": "
|
|
226
|
-
"signature": "
|
|
225
|
+
"version": "e6afae11210d610dae9add48d03ab6a829a82b56ab5dd8c61c250708d9f897d3",
|
|
226
|
+
"signature": "e6afae11210d610dae9add48d03ab6a829a82b56ab5dd8c61c250708d9f897d3",
|
|
227
227
|
"affectsGlobalScope": false
|
|
228
228
|
},
|
|
229
229
|
"../../node_modules/@asgardeo/auth-js/dist/src/models/token.d.ts": {
|
|
@@ -302,8 +302,8 @@
|
|
|
302
302
|
"affectsGlobalScope": false
|
|
303
303
|
},
|
|
304
304
|
"../../node_modules/@asgardeo/auth-js/dist/src/public-api.d.ts": {
|
|
305
|
-
"version": "
|
|
306
|
-
"signature": "
|
|
305
|
+
"version": "e4e6f003f81daf8da7b6618cec01576e970e8e6a7528fb7c254636addaad1c54",
|
|
306
|
+
"signature": "e4e6f003f81daf8da7b6618cec01576e970e8e6a7528fb7c254636addaad1c54",
|
|
307
307
|
"affectsGlobalScope": false
|
|
308
308
|
},
|
|
309
309
|
"../../node_modules/@asgardeo/auth-js/dist/src/index.d.ts": {
|
|
@@ -451,8 +451,8 @@
|
|
|
451
451
|
"affectsGlobalScope": false
|
|
452
452
|
},
|
|
453
453
|
"../src/models.ts": {
|
|
454
|
-
"version": "
|
|
455
|
-
"signature": "
|
|
454
|
+
"version": "2a11abad651952beaf6051d2e4e55bcf477917093613a7de545e0817d4141190",
|
|
455
|
+
"signature": "c9fec124a6c9771f154d651ce6d0121c5c7cff00824aaba5186277dda632ae28",
|
|
456
456
|
"affectsGlobalScope": false
|
|
457
457
|
},
|
|
458
458
|
"../src/api.ts": {
|
|
@@ -466,13 +466,13 @@
|
|
|
466
466
|
"affectsGlobalScope": true
|
|
467
467
|
},
|
|
468
468
|
"../../node_modules/csstype/index.d.ts": {
|
|
469
|
-
"version": "
|
|
470
|
-
"signature": "
|
|
469
|
+
"version": "ea0aa24a32c073b8639aa1f3130ba0add0f0f2f76b314d9ba988a5cb91d7e3c4",
|
|
470
|
+
"signature": "ea0aa24a32c073b8639aa1f3130ba0add0f0f2f76b314d9ba988a5cb91d7e3c4",
|
|
471
471
|
"affectsGlobalScope": false
|
|
472
472
|
},
|
|
473
473
|
"../../node_modules/@types/prop-types/index.d.ts": {
|
|
474
|
-
"version": "
|
|
475
|
-
"signature": "
|
|
474
|
+
"version": "6a386ff939f180ae8ef064699d8b7b6e62bc2731a62d7fbf5e02589383838dea",
|
|
475
|
+
"signature": "6a386ff939f180ae8ef064699d8b7b6e62bc2731a62d7fbf5e02589383838dea",
|
|
476
476
|
"affectsGlobalScope": false
|
|
477
477
|
},
|
|
478
478
|
"../../node_modules/@types/scheduler/tracing.d.ts": {
|
|
@@ -481,18 +481,18 @@
|
|
|
481
481
|
"affectsGlobalScope": false
|
|
482
482
|
},
|
|
483
483
|
"../../node_modules/@types/react/index.d.ts": {
|
|
484
|
-
"version": "
|
|
485
|
-
"signature": "
|
|
484
|
+
"version": "96f7fd25e84591ab3f3fa62c075326ca1f1474784d34e7ae994c095d42c5dc26",
|
|
485
|
+
"signature": "96f7fd25e84591ab3f3fa62c075326ca1f1474784d34e7ae994c095d42c5dc26",
|
|
486
486
|
"affectsGlobalScope": true
|
|
487
487
|
},
|
|
488
488
|
"../../node_modules/@types/react-router/node_modules/@types/react/global.d.ts": {
|
|
489
|
-
"version": "
|
|
490
|
-
"signature": "
|
|
489
|
+
"version": "bbdf156fea2fabed31a569445835aeedcc33643d404fcbaa54541f06c109df3f",
|
|
490
|
+
"signature": "bbdf156fea2fabed31a569445835aeedcc33643d404fcbaa54541f06c109df3f",
|
|
491
491
|
"affectsGlobalScope": true
|
|
492
492
|
},
|
|
493
493
|
"../../node_modules/@types/react-router/node_modules/@types/react/index.d.ts": {
|
|
494
|
-
"version": "
|
|
495
|
-
"signature": "
|
|
494
|
+
"version": "841f34bcd947688df52cf04918b4def20032a4887c4e808ecf1e15ad717de05e",
|
|
495
|
+
"signature": "841f34bcd947688df52cf04918b4def20032a4887c4e808ecf1e15ad717de05e",
|
|
496
496
|
"affectsGlobalScope": true
|
|
497
497
|
},
|
|
498
498
|
"../../node_modules/@types/history/DOMUtils.d.ts": {
|
|
@@ -511,8 +511,8 @@
|
|
|
511
511
|
"affectsGlobalScope": false
|
|
512
512
|
},
|
|
513
513
|
"../../node_modules/@types/history/createMemoryHistory.d.ts": {
|
|
514
|
-
"version": "
|
|
515
|
-
"signature": "
|
|
514
|
+
"version": "9c4e644fe9bf08d93c93bd892705842189fe345163f8896849d5964d21b56b78",
|
|
515
|
+
"signature": "9c4e644fe9bf08d93c93bd892705842189fe345163f8896849d5964d21b56b78",
|
|
516
516
|
"affectsGlobalScope": false
|
|
517
517
|
},
|
|
518
518
|
"../../node_modules/@types/history/LocationUtils.d.ts": {
|
|
@@ -526,23 +526,23 @@
|
|
|
526
526
|
"affectsGlobalScope": false
|
|
527
527
|
},
|
|
528
528
|
"../../node_modules/@types/history/index.d.ts": {
|
|
529
|
-
"version": "
|
|
530
|
-
"signature": "
|
|
529
|
+
"version": "8d32432f68ca4ce93ad717823976f2db2add94c70c19602bf87ee67fe51df48b",
|
|
530
|
+
"signature": "8d32432f68ca4ce93ad717823976f2db2add94c70c19602bf87ee67fe51df48b",
|
|
531
531
|
"affectsGlobalScope": false
|
|
532
532
|
},
|
|
533
533
|
"../../node_modules/@types/react-router/ts4.0/index.d.ts": {
|
|
534
|
-
"version": "
|
|
535
|
-
"signature": "
|
|
534
|
+
"version": "5aceb7eedb572c121641a963a13da253f0d439bf3d77efe8e891d51ab696e1dd",
|
|
535
|
+
"signature": "5aceb7eedb572c121641a963a13da253f0d439bf3d77efe8e891d51ab696e1dd",
|
|
536
536
|
"affectsGlobalScope": false
|
|
537
537
|
},
|
|
538
538
|
"../../node_modules/@types/react-router-dom/node_modules/@types/react/index.d.ts": {
|
|
539
|
-
"version": "
|
|
540
|
-
"signature": "
|
|
539
|
+
"version": "841f34bcd947688df52cf04918b4def20032a4887c4e808ecf1e15ad717de05e",
|
|
540
|
+
"signature": "841f34bcd947688df52cf04918b4def20032a4887c4e808ecf1e15ad717de05e",
|
|
541
541
|
"affectsGlobalScope": true
|
|
542
542
|
},
|
|
543
543
|
"../../node_modules/@types/react-router-dom/index.d.ts": {
|
|
544
|
-
"version": "
|
|
545
|
-
"signature": "
|
|
544
|
+
"version": "8017277c3843df85296d8730f9edf097d68d7d5f9bc9d8124fcacf17ecfd487e",
|
|
545
|
+
"signature": "8017277c3843df85296d8730f9edf097d68d7d5f9bc9d8124fcacf17ecfd487e",
|
|
546
546
|
"affectsGlobalScope": false
|
|
547
547
|
},
|
|
548
548
|
"../src/secure-route.tsx": {
|
|
@@ -571,7 +571,7 @@
|
|
|
571
571
|
"affectsGlobalScope": false
|
|
572
572
|
},
|
|
573
573
|
"../src/authenticate.tsx": {
|
|
574
|
-
"version": "
|
|
574
|
+
"version": "066bd11a17aa256d6ab67679cb0890f21d15bcc5a72d14cff755569abf860980",
|
|
575
575
|
"signature": "336cb282ec49398aece02113130600346cc39c172377aad24e5cb639ce3d226b",
|
|
576
576
|
"affectsGlobalScope": false
|
|
577
577
|
},
|
|
@@ -811,13 +811,13 @@
|
|
|
811
811
|
"affectsGlobalScope": false
|
|
812
812
|
},
|
|
813
813
|
"../../node_modules/@types/minimatch/index.d.ts": {
|
|
814
|
-
"version": "
|
|
815
|
-
"signature": "
|
|
814
|
+
"version": "8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649",
|
|
815
|
+
"signature": "8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649",
|
|
816
816
|
"affectsGlobalScope": false
|
|
817
817
|
},
|
|
818
818
|
"../../node_modules/@types/glob/index.d.ts": {
|
|
819
|
-
"version": "
|
|
820
|
-
"signature": "
|
|
819
|
+
"version": "fd326577c62145816fe1acc306c734c2396487f76719d3785d4e825b34540b33",
|
|
820
|
+
"signature": "fd326577c62145816fe1acc306c734c2396487f76719d3785d4e825b34540b33",
|
|
821
821
|
"affectsGlobalScope": false
|
|
822
822
|
},
|
|
823
823
|
"../../node_modules/@types/html-minifier-terser/index.d.ts": {
|
|
@@ -826,8 +826,8 @@
|
|
|
826
826
|
"affectsGlobalScope": false
|
|
827
827
|
},
|
|
828
828
|
"../../node_modules/@types/json-schema/index.d.ts": {
|
|
829
|
-
"version": "
|
|
830
|
-
"signature": "
|
|
829
|
+
"version": "f3e604694b624fa3f83f6684185452992088f5efb2cf136b62474aa106d6f1b6",
|
|
830
|
+
"signature": "f3e604694b624fa3f83f6684185452992088f5efb2cf136b62474aa106d6f1b6",
|
|
831
831
|
"affectsGlobalScope": false
|
|
832
832
|
},
|
|
833
833
|
"../../node_modules/@types/json5/index.d.ts": {
|
|
@@ -836,13 +836,13 @@
|
|
|
836
836
|
"affectsGlobalScope": false
|
|
837
837
|
},
|
|
838
838
|
"../../node_modules/@types/minimist/index.d.ts": {
|
|
839
|
-
"version": "
|
|
840
|
-
"signature": "
|
|
839
|
+
"version": "209e814e8e71aec74f69686a9506dd7610b97ab59dcee9446266446f72a76d05",
|
|
840
|
+
"signature": "209e814e8e71aec74f69686a9506dd7610b97ab59dcee9446266446f72a76d05",
|
|
841
841
|
"affectsGlobalScope": false
|
|
842
842
|
},
|
|
843
843
|
"../../node_modules/@types/normalize-package-data/index.d.ts": {
|
|
844
|
-
"version": "
|
|
845
|
-
"signature": "
|
|
844
|
+
"version": "6fa0008bf91a4cc9c8963bace4bba0bd6865cbfa29c3e3ccc461155660fb113a",
|
|
845
|
+
"signature": "6fa0008bf91a4cc9c8963bace4bba0bd6865cbfa29c3e3ccc461155660fb113a",
|
|
846
846
|
"affectsGlobalScope": false
|
|
847
847
|
},
|
|
848
848
|
"../../node_modules/@types/react-dom/index.d.ts": {
|
|
@@ -871,11 +871,11 @@
|
|
|
871
871
|
"affectsGlobalScope": false
|
|
872
872
|
},
|
|
873
873
|
"../../node_modules/@types/uglify-js/index.d.ts": {
|
|
874
|
-
"version": "
|
|
875
|
-
"signature": "
|
|
874
|
+
"version": "c6c1427ba1efa270964d61564a3d99b59c0865a51dd55e4beb9f50e5c9aa8b51",
|
|
875
|
+
"signature": "c6c1427ba1efa270964d61564a3d99b59c0865a51dd55e4beb9f50e5c9aa8b51",
|
|
876
876
|
"affectsGlobalScope": false
|
|
877
877
|
},
|
|
878
|
-
"../../node_modules
|
|
878
|
+
"../../node_modules/anymatch/index.d.ts": {
|
|
879
879
|
"version": "4fb0b7d532aa6fb850b6cd2f1ee4f00802d877b5c66a51903bc1fb0624126349",
|
|
880
880
|
"signature": "4fb0b7d532aa6fb850b6cd2f1ee4f00802d877b5c66a51903bc1fb0624126349",
|
|
881
881
|
"affectsGlobalScope": false
|
|
@@ -946,8 +946,8 @@
|
|
|
946
946
|
"affectsGlobalScope": false
|
|
947
947
|
},
|
|
948
948
|
"../../node_modules/@types/webpack/index.d.ts": {
|
|
949
|
-
"version": "
|
|
950
|
-
"signature": "
|
|
949
|
+
"version": "b2f006ee835f315d01c43c0f5d9e9ad78a5870b380899877b32a33078d065dbd",
|
|
950
|
+
"signature": "b2f006ee835f315d01c43c0f5d9e9ad78a5870b380899877b32a33078d065dbd",
|
|
951
951
|
"affectsGlobalScope": false
|
|
952
952
|
}
|
|
953
953
|
},
|
|
@@ -1216,7 +1216,6 @@
|
|
|
1216
1216
|
"../../node_modules/@asgardeo/auth-js/dist/src/models/oidc-provider-meta-data.d.ts"
|
|
1217
1217
|
],
|
|
1218
1218
|
"../../node_modules/@asgardeo/auth-js/dist/src/models/data.d.ts": [
|
|
1219
|
-
"../../node_modules/@asgardeo/auth-js/dist/src/models/client-config.d.ts",
|
|
1220
1219
|
"../../node_modules/@asgardeo/auth-js/dist/src/models/index.d.ts"
|
|
1221
1220
|
],
|
|
1222
1221
|
"../../node_modules/@asgardeo/auth-js/dist/src/models/index.d.ts": [
|
|
@@ -1238,6 +1237,7 @@
|
|
|
1238
1237
|
"../../node_modules/@asgardeo/auth-js/dist/src/constants/data.d.ts",
|
|
1239
1238
|
"../../node_modules/@asgardeo/auth-js/dist/src/constants/parameters.d.ts",
|
|
1240
1239
|
"../../node_modules/@asgardeo/auth-js/dist/src/constants/scopes.d.ts",
|
|
1240
|
+
"../../node_modules/@asgardeo/auth-js/dist/src/data/index.d.ts",
|
|
1241
1241
|
"../../node_modules/@asgardeo/auth-js/dist/src/exception/index.d.ts",
|
|
1242
1242
|
"../../node_modules/@asgardeo/auth-js/dist/src/models/index.d.ts",
|
|
1243
1243
|
"../../node_modules/@asgardeo/auth-js/dist/src/utils/index.d.ts"
|
|
@@ -1341,6 +1341,7 @@
|
|
|
1341
1341
|
"../../node_modules/@types/glob/index.d.ts": [
|
|
1342
1342
|
"../../node_modules/@types/minimatch/index.d.ts",
|
|
1343
1343
|
"../node_modules/@types/node/events.d.ts",
|
|
1344
|
+
"../node_modules/@types/node/fs.d.ts",
|
|
1344
1345
|
"../node_modules/@types/node/index.d.ts"
|
|
1345
1346
|
],
|
|
1346
1347
|
"../../node_modules/@types/history/LocationUtils.d.ts": [
|
|
@@ -1478,7 +1479,7 @@
|
|
|
1478
1479
|
"../../node_modules/@types/tapable/index.d.ts",
|
|
1479
1480
|
"../../node_modules/@types/uglify-js/index.d.ts",
|
|
1480
1481
|
"../../node_modules/@types/webpack-sources/index.d.ts",
|
|
1481
|
-
"../../node_modules
|
|
1482
|
+
"../../node_modules/anymatch/index.d.ts",
|
|
1482
1483
|
"../../node_modules/source-map/source-map.d.ts",
|
|
1483
1484
|
"../node_modules/@types/node/crypto.d.ts",
|
|
1484
1485
|
"../node_modules/@types/node/index.d.ts"
|
|
@@ -1716,7 +1717,6 @@
|
|
|
1716
1717
|
"../../node_modules/@asgardeo/auth-js/dist/src/models/oidc-provider-meta-data.d.ts"
|
|
1717
1718
|
],
|
|
1718
1719
|
"../../node_modules/@asgardeo/auth-js/dist/src/models/data.d.ts": [
|
|
1719
|
-
"../../node_modules/@asgardeo/auth-js/dist/src/models/client-config.d.ts",
|
|
1720
1720
|
"../../node_modules/@asgardeo/auth-js/dist/src/models/index.d.ts"
|
|
1721
1721
|
],
|
|
1722
1722
|
"../../node_modules/@asgardeo/auth-js/dist/src/models/index.d.ts": [
|
|
@@ -1738,6 +1738,7 @@
|
|
|
1738
1738
|
"../../node_modules/@asgardeo/auth-js/dist/src/constants/data.d.ts",
|
|
1739
1739
|
"../../node_modules/@asgardeo/auth-js/dist/src/constants/parameters.d.ts",
|
|
1740
1740
|
"../../node_modules/@asgardeo/auth-js/dist/src/constants/scopes.d.ts",
|
|
1741
|
+
"../../node_modules/@asgardeo/auth-js/dist/src/data/index.d.ts",
|
|
1741
1742
|
"../../node_modules/@asgardeo/auth-js/dist/src/exception/index.d.ts",
|
|
1742
1743
|
"../../node_modules/@asgardeo/auth-js/dist/src/models/index.d.ts",
|
|
1743
1744
|
"../../node_modules/@asgardeo/auth-js/dist/src/utils/index.d.ts"
|
|
@@ -1838,6 +1839,7 @@
|
|
|
1838
1839
|
"../../node_modules/@types/glob/index.d.ts": [
|
|
1839
1840
|
"../../node_modules/@types/minimatch/index.d.ts",
|
|
1840
1841
|
"../node_modules/@types/node/events.d.ts",
|
|
1842
|
+
"../node_modules/@types/node/fs.d.ts",
|
|
1841
1843
|
"../node_modules/@types/node/index.d.ts"
|
|
1842
1844
|
],
|
|
1843
1845
|
"../../node_modules/@types/history/LocationUtils.d.ts": [
|
|
@@ -1975,7 +1977,7 @@
|
|
|
1975
1977
|
"../../node_modules/@types/tapable/index.d.ts",
|
|
1976
1978
|
"../../node_modules/@types/uglify-js/index.d.ts",
|
|
1977
1979
|
"../../node_modules/@types/webpack-sources/index.d.ts",
|
|
1978
|
-
"../../node_modules
|
|
1980
|
+
"../../node_modules/anymatch/index.d.ts",
|
|
1979
1981
|
"../../node_modules/source-map/source-map.d.ts",
|
|
1980
1982
|
"../node_modules/@types/node/crypto.d.ts",
|
|
1981
1983
|
"../node_modules/@types/node/index.d.ts"
|
|
@@ -2168,7 +2170,7 @@
|
|
|
2168
2170
|
"../../node_modules/@types/webpack-sources/lib/index.d.ts",
|
|
2169
2171
|
"../../node_modules/@types/webpack-sources/node_modules/source-map/source-map.d.ts",
|
|
2170
2172
|
"../../node_modules/@types/webpack/index.d.ts",
|
|
2171
|
-
"../../node_modules
|
|
2173
|
+
"../../node_modules/anymatch/index.d.ts",
|
|
2172
2174
|
"../../node_modules/axios/index.d.ts",
|
|
2173
2175
|
"../../node_modules/csstype/index.d.ts",
|
|
2174
2176
|
"../../node_modules/source-map/source-map.d.ts"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asgardeo/auth-react",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "Asgardeo Auth React SDK for React Applications.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"WSO2",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"author": "WSO2",
|
|
37
37
|
"license": "Apache-2.0",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@asgardeo/auth-spa": "^0.3.
|
|
39
|
+
"@asgardeo/auth-spa": "^0.3.4"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@babel/cli": "^7.10.5",
|
package/src/authenticate.tsx
CHANGED
|
@@ -23,7 +23,8 @@ import {
|
|
|
23
23
|
Hooks,
|
|
24
24
|
HttpRequestConfig,
|
|
25
25
|
SPAUtils,
|
|
26
|
-
SignInConfig
|
|
26
|
+
SignInConfig,
|
|
27
|
+
AsgardeoAuthException
|
|
27
28
|
} from "@asgardeo/auth-spa";
|
|
28
29
|
import { SPACustomGrantConfig } from "@asgardeo/auth-spa/src/models/request-custom-grant";
|
|
29
30
|
import React, {
|
|
@@ -80,7 +81,19 @@ const AuthProvider: FunctionComponent<PropsWithChildren<AuthProviderPropsInterfa
|
|
|
80
81
|
authState?: string,
|
|
81
82
|
callback?: (response: BasicUserInfo) => void
|
|
82
83
|
): Promise<BasicUserInfo> => {
|
|
83
|
-
|
|
84
|
+
try {
|
|
85
|
+
return await AuthClient.signIn(
|
|
86
|
+
dispatch,
|
|
87
|
+
state,
|
|
88
|
+
config,
|
|
89
|
+
authorizationCode,
|
|
90
|
+
sessionState,
|
|
91
|
+
authState,
|
|
92
|
+
callback
|
|
93
|
+
);
|
|
94
|
+
} catch (error) {
|
|
95
|
+
return Promise.reject(error);
|
|
96
|
+
}
|
|
84
97
|
};
|
|
85
98
|
const signOut = (callback?: (response: boolean) => void): Promise<boolean> => {
|
|
86
99
|
return AuthClient.signOut(dispatch, state, callback);
|
|
@@ -111,6 +124,8 @@ const AuthProvider: FunctionComponent<PropsWithChildren<AuthProviderPropsInterfa
|
|
|
111
124
|
return AuthClient.on(hook, callback);
|
|
112
125
|
};
|
|
113
126
|
const trySignInSilently = () => AuthClient.trySignInSilently(state, dispatch);
|
|
127
|
+
|
|
128
|
+
const [ error, setError ] = useState<AsgardeoAuthException>();
|
|
114
129
|
|
|
115
130
|
useEffect(() => {
|
|
116
131
|
if (state.isAuthenticated) {
|
|
@@ -156,21 +171,18 @@ const AuthProvider: FunctionComponent<PropsWithChildren<AuthProviderPropsInterfa
|
|
|
156
171
|
|| authParams?.authorizationCode
|
|
157
172
|
|| url.searchParams.get("error") )
|
|
158
173
|
{
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
// Tracked here https://github.com/asgardeo/asgardeo-auth-js-sdk/issues/151.
|
|
172
|
-
throw error;
|
|
173
|
-
});
|
|
174
|
+
try{
|
|
175
|
+
await signIn(
|
|
176
|
+
{ callOnlyOnRedirect: true },
|
|
177
|
+
authParams?.authorizationCode,
|
|
178
|
+
authParams?.sessionState,
|
|
179
|
+
authParams?.state
|
|
180
|
+
);
|
|
181
|
+
} catch(error) {
|
|
182
|
+
if(error instanceof AsgardeoAuthException) {
|
|
183
|
+
setError(error);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
174
186
|
}
|
|
175
187
|
}
|
|
176
188
|
|
|
@@ -204,32 +216,33 @@ const AuthProvider: FunctionComponent<PropsWithChildren<AuthProviderPropsInterfa
|
|
|
204
216
|
* Render state and special case actions
|
|
205
217
|
*/
|
|
206
218
|
return (
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
219
|
+
<AuthContext.Provider
|
|
220
|
+
value={ {
|
|
221
|
+
disableHttpHandler,
|
|
222
|
+
enableHttpHandler,
|
|
223
|
+
getAccessToken,
|
|
224
|
+
getBasicUserInfo,
|
|
225
|
+
getDecodedIDToken,
|
|
226
|
+
getHttpClient,
|
|
227
|
+
getIDToken,
|
|
228
|
+
getOIDCServiceEndpoints,
|
|
229
|
+
httpRequest,
|
|
230
|
+
httpRequestAll,
|
|
231
|
+
isAuthenticated,
|
|
232
|
+
on,
|
|
233
|
+
refreshAccessToken,
|
|
234
|
+
requestCustomGrant,
|
|
235
|
+
revokeAccessToken,
|
|
236
|
+
signIn,
|
|
237
|
+
signOut,
|
|
238
|
+
state,
|
|
239
|
+
trySignInSilently,
|
|
240
|
+
updateConfig,
|
|
241
|
+
error
|
|
242
|
+
} }
|
|
243
|
+
>
|
|
244
|
+
{ initialized ? children : fallback ?? null }
|
|
245
|
+
</AuthContext.Provider>
|
|
233
246
|
);
|
|
234
247
|
};
|
|
235
248
|
|
package/src/models.ts
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import {
|
|
20
|
+
AsgardeoAuthException,
|
|
20
21
|
AuthClientConfig,
|
|
21
22
|
AuthSPAClientConfig,
|
|
22
23
|
BasicUserInfo,
|
|
@@ -118,6 +119,7 @@ export interface AuthContextInterface {
|
|
|
118
119
|
): void;
|
|
119
120
|
on(hook: Hooks, callback: (response?: any) => void, id?: string): void;
|
|
120
121
|
state: AuthStateInterface;
|
|
122
|
+
error: AsgardeoAuthException;
|
|
121
123
|
}
|
|
122
124
|
|
|
123
125
|
export interface SecureRouteInterface {
|