@axa-fr/react-oidc 7.20.1-beta.1399 → 7.20.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.
- package/README.md +4 -0
- package/dist/ReactOidc.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +33 -31
- package/dist/index.umd.cjs +8 -8
- package/package.json +3 -3
- package/src/ReactOidc.tsx +2 -1
- package/src/index.ts +2 -2
package/README.md
CHANGED
|
@@ -223,6 +223,10 @@ const configuration = {
|
|
|
223
223
|
onLogoutFromAnotherTab: Function, // Optional, can be set to override the default behavior, this function is triggered when a user with the same subject is logged out from another tab when session_monitor is active
|
|
224
224
|
onLogoutFromSameTab: Function, // Optional, can be set to override the default behavior, this function is triggered when a user is logged out from the same tab when session_monitor is active
|
|
225
225
|
token_renew_mode: String, // Optional, update tokens based on the selected token(s) lifetime: "access_token_or_id_token_invalid" (default), "access_token_invalid", "id_token_invalid"
|
|
226
|
+
token_automatic_renew_mode: TokenAutomaticRenewMode.AutomaticOnlyWhenFetchExecuted, // Optional, default is TokenAutomaticRenewMode.AutomaticBeforeTokensExpiration
|
|
227
|
+
// TokenAutomaticRenewMode.AutomaticBeforeTokensExpiration: renew tokens automatically before they expire
|
|
228
|
+
// TokenAutomaticRenewMode.AutomaticOnlyWhenFetchExecuted: renew tokens automatically only when fetch is executed
|
|
229
|
+
// It requires you to use fetch given by hook useOidcFetch(fetch) or HOC withOidcFetch(fetch)(Component)
|
|
226
230
|
logout_tokens_to_invalidate: Array<string>, // Optional tokens to invalidate during logout, default: ['access_token', 'refresh_token']
|
|
227
231
|
location: ILOidcLocation, // Optional, default is window.location, you can inject your own location object respecting the ILOidcLocation interface
|
|
228
232
|
demonstrating_proof_of_possession: Boolean, // Optional, default is false, if true, the the Demonstrating Proof of Possession will be activated //https://www.rfc-editor.org/rfc/rfc9449.html#name-protected-resource-access
|
package/dist/ReactOidc.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactOidc.d.ts","sourceRoot":"","sources":["../src/ReactOidc.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAc,MAAM,qBAAqB,CAAC;AAmB5D,eAAO,MAAM,OAAO;2BAuBY,MAAM,GAAG,SAAS,WAAqB,SAAS;4BAG9C,MAAM,GAAG,IAAI,GAAG,SAAS,WAAqB,SAAS;2BAGlD,SAAS,KAAW,QAAQ,eAAe,GAAG,WAAW,CAAC;;CAehG,CAAC;AAkBF,MAAM,MAAM,eAAe,GAAG;IAC1B,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,kBAAkB,CAAC,EAAE,GAAG,CAAC;IACzB,6CAA6C,CAAC,EAAE,GAAG,CAAC;CACvD,CAAA;AAMD,eAAO,MAAM,kBAAkB,iDAoC9B,CAAC;
|
|
1
|
+
{"version":3,"file":"ReactOidc.d.ts","sourceRoot":"","sources":["../src/ReactOidc.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAc,MAAM,qBAAqB,CAAC;AAmB5D,eAAO,MAAM,OAAO;2BAuBY,MAAM,GAAG,SAAS,WAAqB,SAAS;4BAG9C,MAAM,GAAG,IAAI,GAAG,SAAS,WAAqB,SAAS;2BAGlD,SAAS,KAAW,QAAQ,eAAe,GAAG,WAAW,CAAC;;CAehG,CAAC;AAkBF,MAAM,MAAM,eAAe,GAAG;IAC1B,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,kBAAkB,CAAC,EAAE,GAAG,CAAC;IACzB,6CAA6C,CAAC,EAAE,GAAG,CAAC;CACvD,CAAA;AAMD,eAAO,MAAM,kBAAkB,iDAoC9B,CAAC;AAeF,MAAM,MAAM,WAAW,GAAG;IACtB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,cAAc,CAAC,EAAE,GAAG,CAAC;CACxB,CAAA;AAED,eAAO,MAAM,cAAc,6CAgC1B,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,6 @@ export { OidcProvider } from './OidcProvider.js';
|
|
|
3
3
|
export { OidcSecure, withOidcSecure } from './OidcSecure.js';
|
|
4
4
|
export { useOidc, useOidcAccessToken, useOidcIdToken } from './ReactOidc.js';
|
|
5
5
|
export { OidcUserStatus, useOidcUser } from './User.js';
|
|
6
|
-
export type { AuthorityConfiguration, Fetch, OidcConfiguration, StringMap,
|
|
7
|
-
export { type OidcUserInfo, TokenRenewMode, OidcClient } from '@axa-fr/oidc-client';
|
|
6
|
+
export type { AuthorityConfiguration, Fetch, OidcConfiguration, StringMap, ILOidcLocation } from '@axa-fr/oidc-client';
|
|
7
|
+
export { type OidcUserInfo, TokenRenewMode, OidcClient, TokenAutomaticRenewMode, OidcLocation } from '@axa-fr/oidc-client';
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxD,YAAY,EACV,sBAAsB,EACtB,KAAK,EACL,iBAAiB,EACjB,SAAS,EACT,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxD,YAAY,EACV,sBAAsB,EACtB,KAAK,EACL,iBAAiB,EACjB,SAAS,EACT,cAAc,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import me, { useCallback as kt, useState as A, useEffect as S } from "react";
|
|
2
|
-
import { OidcClient as f, getParseQueryStringFromLocation as Et, getPath as z, OidcLocation as
|
|
3
|
-
import { OidcClient as or,
|
|
2
|
+
import { OidcClient as f, getParseQueryStringFromLocation as Et, getPath as z, OidcLocation as Ye, getFetchDefault as Tt } from "@axa-fr/oidc-client";
|
|
3
|
+
import { OidcClient as or, OidcLocation as sr, TokenAutomaticRenewMode as ar, TokenRenewMode as ir } from "@axa-fr/oidc-client";
|
|
4
4
|
var be = { exports: {} }, G = {};
|
|
5
5
|
/**
|
|
6
6
|
* @license React
|
|
@@ -11,11 +11,11 @@ var be = { exports: {} }, G = {};
|
|
|
11
11
|
* This source code is licensed under the MIT license found in the
|
|
12
12
|
* LICENSE file in the root directory of this source tree.
|
|
13
13
|
*/
|
|
14
|
-
var
|
|
14
|
+
var $e;
|
|
15
15
|
function wt() {
|
|
16
|
-
if (
|
|
16
|
+
if ($e)
|
|
17
17
|
return G;
|
|
18
|
-
|
|
18
|
+
$e = 1;
|
|
19
19
|
var o = me, s = Symbol.for("react.element"), r = Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, l = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, u = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
20
20
|
function _(c, v, y) {
|
|
21
21
|
var b, w = {}, x = null, j = null;
|
|
@@ -43,7 +43,7 @@ var Ve;
|
|
|
43
43
|
function Ot() {
|
|
44
44
|
return Ve || (Ve = 1, process.env.NODE_ENV !== "production" && function() {
|
|
45
45
|
var o = me, s = Symbol.for("react.element"), r = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), l = Symbol.for("react.strict_mode"), u = Symbol.for("react.profiler"), _ = Symbol.for("react.provider"), c = Symbol.for("react.context"), v = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"), w = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), j = Symbol.for("react.offscreen"), H = Symbol.iterator, X = "@@iterator";
|
|
46
|
-
function
|
|
46
|
+
function M(e) {
|
|
47
47
|
if (e === null || typeof e != "object")
|
|
48
48
|
return null;
|
|
49
49
|
var t = H && e[H] || e[X];
|
|
@@ -67,10 +67,10 @@ function Ot() {
|
|
|
67
67
|
m.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, m);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
var
|
|
70
|
+
var Y = !1, oe = !1, se = !1, ae = !1, ie = !1, F;
|
|
71
71
|
F = Symbol.for("react.module.reference");
|
|
72
72
|
function ce(e) {
|
|
73
|
-
return !!(typeof e == "string" || typeof e == "function" || e === a || e === u || ie || e === l || e === y || e === b || ae || e === j ||
|
|
73
|
+
return !!(typeof e == "string" || typeof e == "function" || e === a || e === u || ie || e === l || e === y || e === b || ae || e === j || Y || oe || se || typeof e == "object" && e !== null && (e.$$typeof === x || e.$$typeof === w || e.$$typeof === _ || e.$$typeof === c || e.$$typeof === v || // This needs to include all possible module reference object
|
|
74
74
|
// types supported by any Flight configuration anywhere since
|
|
75
75
|
// we don't know which Flight build this will end up being used
|
|
76
76
|
// with.
|
|
@@ -131,14 +131,14 @@ function Ot() {
|
|
|
131
131
|
}
|
|
132
132
|
return null;
|
|
133
133
|
}
|
|
134
|
-
var U = Object.assign, D = 0,
|
|
134
|
+
var U = Object.assign, D = 0, $, E, N, Ee, Te, we, Oe;
|
|
135
135
|
function Ce() {
|
|
136
136
|
}
|
|
137
137
|
Ce.__reactDisabledLog = !0;
|
|
138
138
|
function He() {
|
|
139
139
|
{
|
|
140
140
|
if (D === 0) {
|
|
141
|
-
|
|
141
|
+
$ = console.log, E = console.info, N = console.warn, Ee = console.error, Te = console.group, we = console.groupCollapsed, Oe = console.groupEnd;
|
|
142
142
|
var e = {
|
|
143
143
|
configurable: !0,
|
|
144
144
|
enumerable: !0,
|
|
@@ -168,7 +168,7 @@ function Ot() {
|
|
|
168
168
|
};
|
|
169
169
|
Object.defineProperties(console, {
|
|
170
170
|
log: U({}, e, {
|
|
171
|
-
value:
|
|
171
|
+
value: $
|
|
172
172
|
}),
|
|
173
173
|
info: U({}, e, {
|
|
174
174
|
value: E
|
|
@@ -280,8 +280,8 @@ function Ot() {
|
|
|
280
280
|
} finally {
|
|
281
281
|
fe = !1, ue.current = m, Xe(), Error.prepareStackTrace = g;
|
|
282
282
|
}
|
|
283
|
-
var q = e ? e.displayName || e.name : "",
|
|
284
|
-
return typeof e == "function" && Z.set(e,
|
|
283
|
+
var q = e ? e.displayName || e.name : "", Me = q ? Q(q) : "";
|
|
284
|
+
return typeof e == "function" && Z.set(e, Me), Me;
|
|
285
285
|
}
|
|
286
286
|
function Ze(e, t, n) {
|
|
287
287
|
return Re(e, !1);
|
|
@@ -542,7 +542,7 @@ Check the top-level render call using <` + n + ">.");
|
|
|
542
542
|
else if (ge(e))
|
|
543
543
|
e._store && (e._store.validated = !0);
|
|
544
544
|
else if (e) {
|
|
545
|
-
var g =
|
|
545
|
+
var g = M(e);
|
|
546
546
|
if (typeof g == "function" && g !== e.entries)
|
|
547
547
|
for (var m = g.call(e), p; !(p = m.next()).done; )
|
|
548
548
|
ge(p.value) && Le(p.value, t);
|
|
@@ -720,7 +720,7 @@ const Be = "default", Ct = (o, s) => async (...r) => await s().fetchWithTokens(o
|
|
|
720
720
|
default:
|
|
721
721
|
return /* @__PURE__ */ i.jsx(i.Fragment, { children: u });
|
|
722
722
|
}
|
|
723
|
-
},
|
|
723
|
+
}, Mt = me.memo(Ut), qe = { name: "", data: null }, Yt = ({ loadingComponent: o, children: s, configurationName: r }) => {
|
|
724
724
|
const [a, l] = A(!0), u = f.get, _ = u(r);
|
|
725
725
|
S(() => {
|
|
726
726
|
let v = !0;
|
|
@@ -753,36 +753,36 @@ const Be = "default", Ct = (o, s) => async (...r) => await s().fetchWithTokens(o
|
|
|
753
753
|
getFetch: H = null,
|
|
754
754
|
location: X = null
|
|
755
755
|
}) => {
|
|
756
|
-
const
|
|
756
|
+
const M = (D = "default") => f.getOrCreate(H ?? Tt, X ?? new Ye())(s, D), [L, O] = A(!0), [ne, Y] = A(qe), [oe, se] = A("default");
|
|
757
757
|
S(() => {
|
|
758
|
-
const
|
|
758
|
+
const $ = M(r).subscribeEvents((E, N) => {
|
|
759
759
|
j && j(r, E, N);
|
|
760
760
|
});
|
|
761
761
|
return () => {
|
|
762
|
-
|
|
762
|
+
M(r).removeEventSubscription($);
|
|
763
763
|
};
|
|
764
764
|
}, [r, j]), S(() => {
|
|
765
|
-
const
|
|
765
|
+
const $ = M(r).subscribeEvents((E, N) => {
|
|
766
766
|
if (E === f.eventNames.refreshTokensAsync_error || E === f.eventNames.syncTokensAsync_error) {
|
|
767
767
|
if (y != null) {
|
|
768
768
|
y();
|
|
769
769
|
return;
|
|
770
770
|
}
|
|
771
|
-
|
|
771
|
+
Y({ name: E, data: N });
|
|
772
772
|
} else if (E === f.eventNames.logout_from_another_tab) {
|
|
773
773
|
if (b != null) {
|
|
774
774
|
b();
|
|
775
775
|
return;
|
|
776
776
|
}
|
|
777
|
-
|
|
777
|
+
Y({ name: E, data: N });
|
|
778
778
|
} else
|
|
779
|
-
E === f.eventNames.logout_from_same_tab ? w != null && w() : E === f.eventNames.loginAsync_begin || E === f.eventNames.loginCallbackAsync_end || E === f.eventNames.loginAsync_error || E === f.eventNames.loginCallbackAsync_error ?
|
|
779
|
+
E === f.eventNames.logout_from_same_tab ? w != null && w() : E === f.eventNames.loginAsync_begin || E === f.eventNames.loginCallbackAsync_end || E === f.eventNames.loginAsync_error || E === f.eventNames.loginCallbackAsync_error ? Y({ name: E, data: N }) : E === f.eventNames.service_worker_not_supported_by_browser && s.service_worker_only === !0 && Y({ name: E, data: N });
|
|
780
780
|
});
|
|
781
781
|
return se(r), O(!1), () => {
|
|
782
|
-
|
|
782
|
+
M(r).removeEventSubscription($), Y(qe);
|
|
783
783
|
};
|
|
784
784
|
}, [s, r]);
|
|
785
|
-
const ae = v, ie = l, F = u, ce = _, le = c, W = L || oe !== r, R =
|
|
785
|
+
const ae = v, ie = l, F = u, ce = _, le = c, W = L || oe !== r, R = M(r);
|
|
786
786
|
switch (ne.name) {
|
|
787
787
|
case f.eventNames.service_worker_not_supported_by_browser:
|
|
788
788
|
return /* @__PURE__ */ i.jsx(K, { loadingComponent: F, isLoading: W, configurationName: r, children: /* @__PURE__ */ i.jsx(ce, { configurationName: r }) });
|
|
@@ -797,7 +797,7 @@ const Be = "default", Ct = (o, s) => async (...r) => await s().fetchWithTokens(o
|
|
|
797
797
|
return /* @__PURE__ */ i.jsx(K, { loadingComponent: F, isLoading: W, configurationName: r, children: /* @__PURE__ */ i.jsx(ae, { configurationName: r }) });
|
|
798
798
|
default:
|
|
799
799
|
return /* @__PURE__ */ i.jsx(K, { loadingComponent: F, isLoading: W, configurationName: r, children: /* @__PURE__ */ i.jsx(
|
|
800
|
-
|
|
800
|
+
Mt,
|
|
801
801
|
{
|
|
802
802
|
redirect_uri: R.configuration.redirect_uri,
|
|
803
803
|
silent_redirect_uri: R.configuration.silent_redirect_uri,
|
|
@@ -807,17 +807,17 @@ const Be = "default", Ct = (o, s) => async (...r) => await s().fetchWithTokens(o
|
|
|
807
807
|
authenticatingComponent: l,
|
|
808
808
|
configurationName: r,
|
|
809
809
|
withCustomHistory: x,
|
|
810
|
-
location: X ?? new
|
|
811
|
-
children: /* @__PURE__ */ i.jsx(
|
|
810
|
+
location: X ?? new Ye(),
|
|
811
|
+
children: /* @__PURE__ */ i.jsx(Yt, { loadingComponent: F, configurationName: r, children: o })
|
|
812
812
|
}
|
|
813
813
|
) });
|
|
814
814
|
}
|
|
815
|
-
},
|
|
815
|
+
}, $t = ({ children: o, callbackPath: s = null, extras: r = null, configurationName: a = "default" }) => {
|
|
816
816
|
const l = f.get, u = l(a);
|
|
817
817
|
return S(() => {
|
|
818
818
|
u.tokens || u.loginAsync(s, r);
|
|
819
819
|
}, [a, s, r]), u.tokens ? /* @__PURE__ */ i.jsx(i.Fragment, { children: o }) : null;
|
|
820
|
-
}, Xt = (o, s = null, r = null, a = "default") => (l) => /* @__PURE__ */ i.jsx(
|
|
820
|
+
}, Xt = (o, s = null, r = null, a = "default") => (l) => /* @__PURE__ */ i.jsx($t, { callbackPath: s, extras: r, configurationName: a, children: /* @__PURE__ */ i.jsx(o, { ...l }) }), ke = "default", ye = (o, s) => {
|
|
821
821
|
let r = !1;
|
|
822
822
|
return o(s) && (r = o(s).tokens != null), r;
|
|
823
823
|
}, Qt = (o = ke) => {
|
|
@@ -962,10 +962,12 @@ const tr = (o = "default") => {
|
|
|
962
962
|
};
|
|
963
963
|
export {
|
|
964
964
|
or as OidcClient,
|
|
965
|
+
sr as OidcLocation,
|
|
965
966
|
Ht as OidcProvider,
|
|
966
|
-
|
|
967
|
+
$t as OidcSecure,
|
|
967
968
|
zt as OidcUserStatus,
|
|
968
|
-
|
|
969
|
+
ar as TokenAutomaticRenewMode,
|
|
970
|
+
ir as TokenRenewMode,
|
|
969
971
|
Qt as useOidc,
|
|
970
972
|
Zt as useOidcAccessToken,
|
|
971
973
|
Rt as useOidcFetch,
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(O,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("react"),require("@axa-fr/oidc-client")):typeof define=="function"&&define.amd?define(["exports","react","@axa-fr/oidc-client"],g):(O=typeof globalThis<"u"?globalThis:O||self,g(O["react-oidc"]={},O.React,O.oidcClient))})(this,function(O,g,c){"use strict";var ne={exports:{}},G={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var me;function Qe(){if(me)return G;me=1;var s=g,o=Symbol.for("react.element"),n=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,u=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function _(l,v,b){var m,R={},C=null,x=null;b!==void 0&&(C=""+b),v.key!==void 0&&(C=""+v.key),v.ref!==void 0&&(x=v.ref);for(m in v)a.call(v,m)&&!f.hasOwnProperty(m)&&(R[m]=v[m]);if(l&&l.defaultProps)for(m in v=l.defaultProps,v)R[m]===void 0&&(R[m]=v[m]);return{$$typeof:o,type:l,key:C,ref:x,props:R,_owner:u.current}}return G.Fragment=n,G.jsx=_,G.jsxs=_,G}var J={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
18
|
-
`+ve+e}}var he=!1,q;{var wt=typeof WeakMap=="function"?WeakMap:Map;q=new wt}function Ie(e,t){if(!e||he)return"";{var r=q.get(e);if(r!==void 0)return r}var d;he=!0;var y=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var
|
|
17
|
+
*/var ke;function Ze(){return ke||(ke=1,process.env.NODE_ENV!=="production"&&function(){var s=g,o=Symbol.for("react.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),_=Symbol.for("react.provider"),l=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),X=Symbol.iterator,Q="@@iterator";function W(e){if(e===null||typeof e!="object")return null;var t=X&&e[X]||e[Q];return typeof t=="function"?t:null}var L=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(e){{for(var t=arguments.length,r=new Array(t>1?t-1:0),d=1;d<t;d++)r[d-1]=arguments[d];oe("error",e,r)}}function oe(e,t,r){{var d=L.ReactDebugCurrentFrame,y=d.getStackAddendum();y!==""&&(t+="%s",r=r.concat([y]));var k=r.map(function(p){return String(p)});k.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,k)}}var Y=!1,ae=!1,ce=!1,ie=!1,le=!1,F;F=Symbol.for("react.module.reference");function ue(e){return!!(typeof e=="string"||typeof e=="function"||e===a||e===f||le||e===u||e===b||e===m||ie||e===x||Y||ae||ce||typeof e=="object"&&e!==null&&(e.$$typeof===C||e.$$typeof===R||e.$$typeof===_||e.$$typeof===l||e.$$typeof===v||e.$$typeof===F||e.getModuleId!==void 0))}function fe(e,t,r){var d=e.displayName;if(d)return d;var y=t.displayName||t.name||"";return y!==""?r+"("+y+")":r}function U(e){return e.displayName||"Context"}function P(e){if(e==null)return null;if(typeof e.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case a:return"Fragment";case n:return"Portal";case f:return"Profiler";case u:return"StrictMode";case b:return"Suspense";case m:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case l:var t=e;return U(t)+".Consumer";case _:var r=e;return U(r._context)+".Provider";case v:return fe(e,e.render,"ForwardRef");case R:var d=e.displayName||null;return d!==null?d:P(e.type)||"Memo";case C:{var y=e,k=y._payload,p=y._init;try{return P(p(k))}catch{return null}}}return null}var M=Object.assign,D=0,V,T,N,xe,Ae,Fe,De;function Ne(){}Ne.__reactDisabledLog=!0;function Et(){{if(D===0){V=console.log,T=console.info,N=console.warn,xe=console.error,Ae=console.group,Fe=console.groupCollapsed,De=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Ne,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}D++}}function Tt(){{if(D--,D===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:M({},e,{value:V}),info:M({},e,{value:T}),warn:M({},e,{value:N}),error:M({},e,{value:xe}),group:M({},e,{value:Ae}),groupCollapsed:M({},e,{value:Fe}),groupEnd:M({},e,{value:De})})}D<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var de=L.ReactCurrentDispatcher,ve;function Z(e,t,r){{if(ve===void 0)try{throw Error()}catch(y){var d=y.stack.trim().match(/\n( *(at )?)/);ve=d&&d[1]||""}return`
|
|
18
|
+
`+ve+e}}var he=!1,q;{var wt=typeof WeakMap=="function"?WeakMap:Map;q=new wt}function Ie(e,t){if(!e||he)return"";{var r=q.get(e);if(r!==void 0)return r}var d;he=!0;var y=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var k;k=de.current,de.current=null,Et();try{if(t){var p=function(){throw Error()};if(Object.defineProperty(p.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(p,[])}catch(I){d=I}Reflect.construct(e,[],p)}else{try{p.call()}catch(I){d=I}e.call(p.prototype)}}else{try{throw Error()}catch(I){d=I}e()}}catch(I){if(I&&d&&typeof I.stack=="string"){for(var h=I.stack.split(`
|
|
19
19
|
`),j=d.stack.split(`
|
|
20
|
-
`),
|
|
21
|
-
`+h[
|
|
20
|
+
`),E=h.length-1,w=j.length-1;E>=1&&w>=0&&h[E]!==j[w];)w--;for(;E>=1&&w>=0;E--,w--)if(h[E]!==j[w]){if(E!==1||w!==1)do if(E--,w--,w<0||h[E]!==j[w]){var A=`
|
|
21
|
+
`+h[E].replace(" at new "," at ");return e.displayName&&A.includes("<anonymous>")&&(A=A.replace("<anonymous>",e.displayName)),typeof e=="function"&&q.set(e,A),A}while(E>=1&&w>=0);break}}}finally{he=!1,de.current=k,Tt(),Error.prepareStackTrace=y}var z=e?e.displayName||e.name:"",Xe=z?Z(z):"";return typeof e=="function"&&q.set(e,Xe),Xe}function Rt(e,t,r){return Ie(e,!1)}function St(e){var t=e.prototype;return!!(t&&t.isReactComponent)}function $(e,t,r){if(e==null)return"";if(typeof e=="function")return Ie(e,St(e));if(typeof e=="string")return Z(e);switch(e){case b:return Z("Suspense");case m:return Z("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case v:return Rt(e.render);case R:return $(e.type,t,r);case C:{var d=e,y=d._payload,k=d._init;try{return $(k(y),t,r)}catch{}}}return""}var ee=Object.prototype.hasOwnProperty,Le={},Ue=L.ReactDebugCurrentFrame;function te(e){if(e){var t=e._owner,r=$(e.type,e._source,t?t.type:null);Ue.setExtraStackFrame(r)}else Ue.setExtraStackFrame(null)}function jt(e,t,r,d,y){{var k=Function.call.bind(ee);for(var p in e)if(k(e,p)){var h=void 0;try{if(typeof e[p]!="function"){var j=Error((d||"React class")+": "+r+" type `"+p+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[p]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw j.name="Invariant Violation",j}h=e[p](t,p,d,r,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(E){h=E}h&&!(h instanceof Error)&&(te(y),S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",d||"React class",r,p,typeof h),te(null)),h instanceof Error&&!(h.message in Le)&&(Le[h.message]=!0,te(y),S("Failed %s type: %s",r,h.message),te(null))}}}var Pt=Array.isArray;function pe(e){return Pt(e)}function Ct(e){{var t=typeof Symbol=="function"&&Symbol.toStringTag,r=t&&e[Symbol.toStringTag]||e.constructor.name||"Object";return r}}function xt(e){try{return Me(e),!1}catch{return!0}}function Me(e){return""+e}function We(e){if(xt(e))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ct(e)),Me(e)}var H=L.ReactCurrentOwner,At={key:!0,ref:!0,__self:!0,__source:!0},Ye,Ve,_e;_e={};function Ft(e){if(ee.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return e.ref!==void 0}function Dt(e){if(ee.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function Nt(e,t){if(typeof e.ref=="string"&&H.current&&t&&H.current.stateNode!==t){var r=P(H.current.type);_e[r]||(S('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',P(H.current.type),e.ref),_e[r]=!0)}}function It(e,t){{var r=function(){Ye||(Ye=!0,S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};r.isReactWarning=!0,Object.defineProperty(e,"key",{get:r,configurable:!0})}}function Lt(e,t){{var r=function(){Ve||(Ve=!0,S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};r.isReactWarning=!0,Object.defineProperty(e,"ref",{get:r,configurable:!0})}}var Ut=function(e,t,r,d,y,k,p){var h={$$typeof:o,type:e,key:t,ref:r,props:p,_owner:k};return h._store={},Object.defineProperty(h._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(h,"_self",{configurable:!1,enumerable:!1,writable:!1,value:d}),Object.defineProperty(h,"_source",{configurable:!1,enumerable:!1,writable:!1,value:y}),Object.freeze&&(Object.freeze(h.props),Object.freeze(h)),h};function Mt(e,t,r,d,y){{var k,p={},h=null,j=null;r!==void 0&&(We(r),h=""+r),Dt(t)&&(We(t.key),h=""+t.key),Ft(t)&&(j=t.ref,Nt(t,y));for(k in t)ee.call(t,k)&&!At.hasOwnProperty(k)&&(p[k]=t[k]);if(e&&e.defaultProps){var E=e.defaultProps;for(k in E)p[k]===void 0&&(p[k]=E[k])}if(h||j){var w=typeof e=="function"?e.displayName||e.name||"Unknown":e;h&&It(p,w),j&&Lt(p,w)}return Ut(e,h,j,y,d,H.current,p)}}var ge=L.ReactCurrentOwner,Be=L.ReactDebugCurrentFrame;function B(e){if(e){var t=e._owner,r=$(e.type,e._source,t?t.type:null);Be.setExtraStackFrame(r)}else Be.setExtraStackFrame(null)}var ye;ye=!1;function be(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}function ze(){{if(ge.current){var e=P(ge.current.type);if(e)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function Wt(e){{if(e!==void 0){var t=e.fileName.replace(/^.*[\\\/]/,""),r=e.lineNumber;return`
|
|
24
24
|
|
|
25
25
|
Check your code at `+t+":"+r+"."}return""}}var Ge={};function Yt(e){{var t=ze();if(!t){var r=typeof e=="string"?e:e.displayName||e.name;r&&(t=`
|
|
26
26
|
|
|
27
|
-
Check the top-level render call using <`+r+">.")}return t}}function Je(e,t){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var r=Yt(t);if(Ge[r])return;Ge[r]=!0;var d="";e&&e._owner&&e._owner!==ge.current&&(d=" It was passed a child from "+P(e._owner.type)+"."),B(e),R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',r,d),B(null)}}function Ke(e,t){{if(typeof e!="object")return;if(pe(e))for(var r=0;r<e.length;r++){var d=e[r];be(d)&&Je(d,t)}else if(be(e))e._store&&(e._store.validated=!0);else if(e){var y=M(e);if(typeof y=="function"&&y!==e.entries)for(var m=y.call(e),p;!(p=m.next()).done;)be(p.value)&&Je(p.value,t)}}}function Vt(e){{var t=e.type;if(t==null||typeof t=="string")return;var r;if(typeof t=="function")r=t.propTypes;else if(typeof t=="object"&&(t.$$typeof===v||t.$$typeof===S))r=t.propTypes;else return;if(r){var d=P(t);jt(r,e.props,"prop",d,e)}else if(t.PropTypes!==void 0&&!ye){ye=!0;var y=P(t);R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",y||"Unknown")}typeof t.getDefaultProps=="function"&&!t.getDefaultProps.isReactClassApproved&&R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Bt(e){{for(var t=Object.keys(e.props),r=0;r<t.length;r++){var d=t[r];if(d!=="children"&&d!=="key"){B(e),R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",d),B(null);break}}e.ref!==null&&(B(e),R("Invalid attribute `ref` supplied to `React.Fragment`."),B(null))}}function He(e,t,r,d,y,m){{var p=ue(e);if(!p){var h="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(h+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var j=Mt(y);j?h+=j:h+=ze();var O;e===null?O="null":pe(e)?O="array":e!==void 0&&e.$$typeof===o?(O="<"+(P(e.type)||"Unknown")+" />",h=" Did you accidentally export a JSX literal instead of a component?"):O=typeof e,R("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",O,h)}var T=Wt(e,t,r,y,m);if(T==null)return T;if(p){var A=t.children;if(A!==void 0)if(d)if(pe(A)){for(var z=0;z<A.length;z++)Ke(A[z],e);Object.freeze&&Object.freeze(A)}else R("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ke(A,e)}return e===a?Bt(T):Vt(T),T}}function zt(e,t,r){return He(e,t,r,!0)}function Gt(e,t,r){return He(e,t,r,!1)}var Jt=Gt,Kt=zt;J.Fragment=a,J.jsx=Jt,J.jsxs=Kt}()),J}process.env.NODE_ENV==="production"?ne.exports=Qe():ne.exports=Ze();var i=ne.exports;const Oe="default",qe=(s,o)=>async(...n)=>await o().fetchWithTokens(s)(...n),$e=(s=null,o=Oe)=>n=>a=>{const{fetch:u}=Ee(s||a.fetch,o);return i.jsx(n,{...a,fetch:u})},Ee=(s=null,o=Oe)=>{const n=s||window.fetch,a=c.OidcClient.get;return{fetch:g.useCallback((f,_)=>qe(n,()=>a(o))(f,_),[n,o])}},Te=()=>i.jsx("div",{className:"oidc-authenticating",children:i.jsxs("div",{className:"oidc-authenticating__container",children:[i.jsx("h1",{className:"oidc-authenticating__title",children:"Error authentication"}),i.jsx("p",{className:"oidc-authenticating__content",children:"An error occurred during authentication."})]})}),et=()=>i.jsx("div",{className:"oidc-authenticating",children:i.jsxs("div",{className:"oidc-authenticating__container",children:[i.jsx("h1",{className:"oidc-authenticating__title",children:"Authentication in progress"}),i.jsx("p",{className:"oidc-authenticating__content",children:"You will be redirected to the login page."})]})}),tt=()=>Math.random().toString(36).substr(2,6),nt=(s,o)=>(n,a)=>{if(typeof s.CustomEvent=="function")return new s.CustomEvent(n,a);const u=a||{bubbles:!1,cancelable:!1,detail:void 0},f=o.createEvent("CustomEvent");return f.initCustomEvent(n,u.bubbles,u.cancelable,u.detail),f.prototype=s.Event.prototype,f},rt=(s,o,n)=>({replaceState:(a,u)=>{const f=n(),_=u||s.history.state;s.history.replaceState({key:f,state:_},null,a),s.dispatchEvent(o("popstate"))}}),st=()=>rt(window,nt(window,document),tt),we=()=>i.jsx("div",{className:"oidc-callback",children:i.jsxs("div",{className:"oidc-callback__container",children:[i.jsx("h1",{className:"oidc-callback__title",children:"Authentication complete"}),i.jsx("p",{className:"oidc-callback__content",children:"You will be redirected to your application."})]})}),ot=({callBackError:s,callBackSuccess:o,configurationName:n,withCustomHistory:a})=>{const[u,f]=g.useState(!1);g.useEffect(()=>{let v=!0;return(async()=>{const k=c.OidcClient.get;try{const{callbackPath:S}=await k(n).loginCallbackAsync();(a?a():st()).replaceState(S||"/")}catch(S){v&&(console.warn(S),f(!0))}})(),()=>{v=!1}},[]);const _=s||Te,l=o||we;return u?i.jsx(_,{configurationName:n}):i.jsx(l,{configurationName:n})},at=()=>i.jsx("span",{className:"oidc-loading",children:"Loading"}),ct=()=>i.jsx("div",{className:"oidc-serviceworker",children:i.jsxs("div",{className:"oidc-serviceworker__container",children:[i.jsx("h1",{className:"oidc-serviceworker__title",children:"Unable to authenticate on this browser"}),i.jsx("p",{className:"oidc-serviceworker__content",children:"Your browser is not secure enough to make authentication work. Try updating your browser or use a newer browser."})]})}),it=()=>i.jsx("div",{className:"oidc-session-lost",children:i.jsxs("div",{className:"oidc-session-lost__container",children:[i.jsx("h1",{className:"oidc-session-lost__title",children:"Session timed out"}),i.jsx("p",{className:"oidc-session-lost__content",children:"Your session has expired. Please re-authenticate."})]})}),lt=({configurationName:s})=>(g.useEffect(()=>{(async()=>{const n=c.OidcClient.get;n(s).silentLoginCallbackAsync()})()},[]),i.jsx(i.Fragment,{})),ut=({configurationName:s})=>{const o=c.getParseQueryStringFromLocation(window.location.href),n=c.OidcClient.get,a=n(s);let u=null;for(const[f,_]of Object.entries(o))f==="state"||f==="scope"||(u===null&&(u={}),u[f]=_);return g.useEffect(()=>{a.tokens||a.loginAsync(null,u,!0,o.scope)},[]),i.jsx(i.Fragment,{})},ft=({callbackErrorComponent:s,callbackSuccessComponent:o,redirect_uri:n,silent_redirect_uri:a,silent_login_uri:u,children:f,configurationName:_,withCustomHistory:l=null,location:v})=>{const b=window?c.getPath(window.location.href):"",[k,S]=g.useState(b);g.useEffect(()=>{const x=()=>S(c.getPath(window.location.href));return x(),window.addEventListener("popstate",x,!1),()=>window.removeEventListener("popstate",x,!1)},[]);const C=c.getPath(n);if(a&&k===c.getPath(a))return i.jsx(lt,{configurationName:_});if(u&&k===c.getPath(u))return i.jsx(ut,{configurationName:_});switch(k){case C:return i.jsx(ot,{callBackError:s,callBackSuccess:o,configurationName:_,withCustomHistory:l});default:return i.jsx(i.Fragment,{children:f})}},dt=g.memo(ft),Se={name:"",data:null},vt=({loadingComponent:s,children:o,configurationName:n})=>{const[a,u]=g.useState(!0),f=c.OidcClient.get,_=f(n);g.useEffect(()=>{let v=!0;return _&&_.tryKeepExistingSessionAsync().then(()=>{v&&u(!1)}),()=>{v=!1}},[n]);const l=s;return i.jsx(i.Fragment,{children:a?i.jsx(l,{configurationName:n}):i.jsx(i.Fragment,{children:o})})},K=({isLoading:s,loadingComponent:o,children:n,configurationName:a})=>{const u=o;return s?i.jsx(u,{configurationName:a,children:n}):i.jsx(i.Fragment,{children:n})},ht=({children:s,configuration:o,configurationName:n="default",callbackSuccessComponent:a=we,authenticatingComponent:u=et,loadingComponent:f=at,serviceWorkerNotSupportedComponent:_=ct,authenticatingErrorComponent:l=Te,sessionLostComponent:v=it,onSessionLost:b=null,onLogoutFromAnotherTab:k=null,onLogoutFromSameTab:S=null,withCustomHistory:C=null,onEvent:x=null,getFetch:X=null,location:Q=null})=>{const M=(D="default")=>c.OidcClient.getOrCreate(X??c.getFetchDefault,Q??new c.OidcLocation)(o,D),[L,R]=g.useState(!0),[oe,Y]=g.useState(Se),[ae,ce]=g.useState("default");g.useEffect(()=>{const V=M(n).subscribeEvents((E,N)=>{x&&x(n,E,N)});return()=>{M(n).removeEventSubscription(V)}},[n,x]),g.useEffect(()=>{const V=M(n).subscribeEvents((E,N)=>{if(E===c.OidcClient.eventNames.refreshTokensAsync_error||E===c.OidcClient.eventNames.syncTokensAsync_error){if(b!=null){b();return}Y({name:E,data:N})}else if(E===c.OidcClient.eventNames.logout_from_another_tab){if(k!=null){k();return}Y({name:E,data:N})}else E===c.OidcClient.eventNames.logout_from_same_tab?S!=null&&S():E===c.OidcClient.eventNames.loginAsync_begin||E===c.OidcClient.eventNames.loginCallbackAsync_end||E===c.OidcClient.eventNames.loginAsync_error||E===c.OidcClient.eventNames.loginCallbackAsync_error?Y({name:E,data:N}):E===c.OidcClient.eventNames.service_worker_not_supported_by_browser&&o.service_worker_only===!0&&Y({name:E,data:N})});return ce(n),R(!1),()=>{M(n).removeEventSubscription(V),Y(Se)}},[o,n]);const ie=v,le=u,F=f,ue=_,fe=l,U=L||ae!==n,P=M(n);switch(oe.name){case c.OidcClient.eventNames.service_worker_not_supported_by_browser:return i.jsx(K,{loadingComponent:F,isLoading:U,configurationName:n,children:i.jsx(ue,{configurationName:n})});case c.OidcClient.eventNames.loginAsync_begin:return i.jsx(K,{loadingComponent:F,isLoading:U,configurationName:n,children:i.jsx(le,{configurationName:n})});case c.OidcClient.eventNames.loginAsync_error:case c.OidcClient.eventNames.loginCallbackAsync_error:return i.jsx(K,{loadingComponent:F,isLoading:U,configurationName:n,children:i.jsx(fe,{configurationName:n})});case c.OidcClient.eventNames.refreshTokensAsync_error:case c.OidcClient.eventNames.syncTokensAsync_error:case c.OidcClient.eventNames.logout_from_another_tab:return i.jsx(K,{loadingComponent:F,isLoading:U,configurationName:n,children:i.jsx(ie,{configurationName:n})});default:return i.jsx(K,{loadingComponent:F,isLoading:U,configurationName:n,children:i.jsx(dt,{redirect_uri:P.configuration.redirect_uri,silent_redirect_uri:P.configuration.silent_redirect_uri,silent_login_uri:P.configuration.silent_login_uri,callbackSuccessComponent:a,callbackErrorComponent:l,authenticatingComponent:u,configurationName:n,withCustomHistory:C,location:Q??new c.OidcLocation,children:i.jsx(vt,{loadingComponent:F,configurationName:n,children:s})})})}},Re=({children:s,callbackPath:o=null,extras:n=null,configurationName:a="default"})=>{const u=c.OidcClient.get,f=u(a);return g.useEffect(()=>{f.tokens||f.loginAsync(o,n)},[a,o,n]),f.tokens?i.jsx(i.Fragment,{children:s}):null},pt=(s,o=null,n=null,a="default")=>u=>i.jsx(Re,{callbackPath:o,extras:n,configurationName:a,children:i.jsx(s,{...u})}),re="default",se=(s,o)=>{let n=!1;return s(o)&&(n=s(o).tokens!=null),n},_t=(s=re)=>{const o=c.OidcClient.get,[n,a]=g.useState(se(o,s));return g.useEffect(()=>{let l=!0;const v=o(s);a(se(o,s));const b=v.subscribeEvents((k,S)=>{(k===c.OidcClient.eventNames.logout_from_another_tab||k===c.OidcClient.eventNames.logout_from_same_tab||k===c.OidcClient.eventNames.token_aquired)&&l&&a(se(o,s))});return()=>{l=!1,v.removeEventSubscription(b)}},[s]),{login:(l=void 0,v=null,b=!1)=>o(s).loginAsync(l,v,!1,void 0,b),logout:(l=void 0,v=null)=>o(s).logoutAsync(l,v),renewTokens:async(l=null)=>{const v=await o(s).renewTokensAsync(l);return{accessToken:v.accessToken,accessTokenPayload:v.accessTokenPayload,idToken:v.idToken,idTokenPayload:v.idTokenPayload}},isAuthenticated:n}},je={accessToken:null,accessTokenPayload:null},gt=s=>{const o=c.OidcClient.get,n=o(s);if(n.tokens){const a=n.tokens;return{accessToken:a.accessToken,accessTokenPayload:a.accessTokenPayload,generateDemonstrationOfProofOfPossessionAsync:n.configuration.demonstrating_proof_of_possession?(u,f)=>n.generateDemonstrationOfProofOfPossessionAsync(a.accessToken,u,f):null}}return je};function yt(s,o){return s.configuration.demonstrating_proof_of_possession?(n,a)=>s.generateDemonstrationOfProofOfPossessionAsync(o.accessToken,n,a):null}const bt=(s=re)=>{const o=c.OidcClient.get,[n,a]=g.useState(gt(s));return g.useEffect(()=>{let u=!0;const f=o(s);if(f.tokens){const l=f.tokens;a({accessToken:l.accessToken,accessTokenPayload:l.accessTokenPayload})}const _=f.subscribeEvents((l,v)=>{if((l===c.OidcClient.eventNames.token_renewed||l===c.OidcClient.eventNames.token_aquired||l===c.OidcClient.eventNames.logout_from_another_tab||l===c.OidcClient.eventNames.logout_from_same_tab||l===c.OidcClient.eventNames.refreshTokensAsync_error||l===c.OidcClient.eventNames.syncTokensAsync_error)&&u){const b=f.tokens;a(b!=null?{accessToken:b.accessToken,accessTokenPayload:b.accessTokenPayload,generateDemonstrationOfProofOfPossessionAsync:yt(f,b)}:je)}});return()=>{u=!1,f.removeEventSubscription(_)}},[s]),n},Pe={idToken:null,idTokenPayload:null},kt=s=>{const o=c.OidcClient.get,n=o(s);if(n.tokens){const a=n.tokens;return{idToken:a.idToken,idTokenPayload:a.idTokenPayload}}return Pe},mt=(s=re)=>{const o=c.OidcClient.get,[n,a]=g.useState(kt(s));return g.useEffect(()=>{let u=!0;const f=o(s);if(f.tokens){const l=f.tokens;a({idToken:l.idToken,idTokenPayload:l.idTokenPayload})}const _=f.subscribeEvents((l,v)=>{if((l===c.OidcClient.eventNames.token_renewed||l===c.OidcClient.eventNames.token_aquired||l===c.OidcClient.eventNames.logout_from_another_tab||l===c.OidcClient.eventNames.logout_from_same_tab||l===c.OidcClient.eventNames.refreshTokensAsync_error||l===c.OidcClient.eventNames.syncTokensAsync_error)&&u){const b=f.tokens;a(b!=null?{idToken:b.idToken,idTokenPayload:b.idTokenPayload}:Pe)}});return()=>{u=!1,f.removeEventSubscription(_)}},[s]),n};var Ce=(s=>(s.Unauthenticated="Unauthenticated",s.Loading="Loading user",s.Loaded="User loaded",s.LoadingError="Error loading user",s))(Ce||{});const Ot=(s="default")=>{const[o,n]=g.useState({user:null,status:"Unauthenticated"}),[a,u]=g.useState("");g.useEffect(()=>{const _=c.OidcClient.get(s);let l=!0;if(_&&_.tokens){n({...o,status:"Loading user"});const b=a!=="";_.userInfoAsync(b).then(k=>{l&&n({user:k,status:"User loaded"})}).catch(()=>n({...o,status:"Error loading user"}))}else n({user:null,status:"Unauthenticated"});const v=_.subscribeEvents((b,k)=>{(b===c.OidcClient.eventNames.logout_from_another_tab||b===c.OidcClient.eventNames.logout_from_same_tab)&&l&&n({user:null,status:"Unauthenticated"})});return()=>{l=!1,_.removeEventSubscription(v)}},[a]);const f=()=>{u(a+" ")};return{oidcUser:o.user,oidcUserLoadingState:o.status,reloadOidcUser:f}};Object.defineProperty(w,"OidcClient",{enumerable:!0,get:()=>c.OidcClient}),Object.defineProperty(w,"TokenRenewMode",{enumerable:!0,get:()=>c.TokenRenewMode}),w.OidcProvider=ht,w.OidcSecure=Re,w.OidcUserStatus=Ce,w.useOidc=_t,w.useOidcAccessToken=bt,w.useOidcFetch=Ee,w.useOidcIdToken=mt,w.useOidcUser=Ot,w.withOidcFetch=$e,w.withOidcSecure=pt,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
|
|
27
|
+
Check the top-level render call using <`+r+">.")}return t}}function Je(e,t){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var r=Yt(t);if(Ge[r])return;Ge[r]=!0;var d="";e&&e._owner&&e._owner!==ge.current&&(d=" It was passed a child from "+P(e._owner.type)+"."),B(e),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',r,d),B(null)}}function Ke(e,t){{if(typeof e!="object")return;if(pe(e))for(var r=0;r<e.length;r++){var d=e[r];be(d)&&Je(d,t)}else if(be(e))e._store&&(e._store.validated=!0);else if(e){var y=W(e);if(typeof y=="function"&&y!==e.entries)for(var k=y.call(e),p;!(p=k.next()).done;)be(p.value)&&Je(p.value,t)}}}function Vt(e){{var t=e.type;if(t==null||typeof t=="string")return;var r;if(typeof t=="function")r=t.propTypes;else if(typeof t=="object"&&(t.$$typeof===v||t.$$typeof===R))r=t.propTypes;else return;if(r){var d=P(t);jt(r,e.props,"prop",d,e)}else if(t.PropTypes!==void 0&&!ye){ye=!0;var y=P(t);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",y||"Unknown")}typeof t.getDefaultProps=="function"&&!t.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Bt(e){{for(var t=Object.keys(e.props),r=0;r<t.length;r++){var d=t[r];if(d!=="children"&&d!=="key"){B(e),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",d),B(null);break}}e.ref!==null&&(B(e),S("Invalid attribute `ref` supplied to `React.Fragment`."),B(null))}}function He(e,t,r,d,y,k){{var p=ue(e);if(!p){var h="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(h+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var j=Wt(y);j?h+=j:h+=ze();var E;e===null?E="null":pe(e)?E="array":e!==void 0&&e.$$typeof===o?(E="<"+(P(e.type)||"Unknown")+" />",h=" Did you accidentally export a JSX literal instead of a component?"):E=typeof e,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",E,h)}var w=Mt(e,t,r,y,k);if(w==null)return w;if(p){var A=t.children;if(A!==void 0)if(d)if(pe(A)){for(var z=0;z<A.length;z++)Ke(A[z],e);Object.freeze&&Object.freeze(A)}else S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ke(A,e)}return e===a?Bt(w):Vt(w),w}}function zt(e,t,r){return He(e,t,r,!0)}function Gt(e,t,r){return He(e,t,r,!1)}var Jt=Gt,Kt=zt;J.Fragment=a,J.jsx=Jt,J.jsxs=Kt}()),J}process.env.NODE_ENV==="production"?ne.exports=Qe():ne.exports=Ze();var i=ne.exports;const Oe="default",qe=(s,o)=>async(...n)=>await o().fetchWithTokens(s)(...n),$e=(s=null,o=Oe)=>n=>a=>{const{fetch:u}=Ee(s||a.fetch,o);return i.jsx(n,{...a,fetch:u})},Ee=(s=null,o=Oe)=>{const n=s||window.fetch,a=c.OidcClient.get;return{fetch:g.useCallback((f,_)=>qe(n,()=>a(o))(f,_),[n,o])}},Te=()=>i.jsx("div",{className:"oidc-authenticating",children:i.jsxs("div",{className:"oidc-authenticating__container",children:[i.jsx("h1",{className:"oidc-authenticating__title",children:"Error authentication"}),i.jsx("p",{className:"oidc-authenticating__content",children:"An error occurred during authentication."})]})}),et=()=>i.jsx("div",{className:"oidc-authenticating",children:i.jsxs("div",{className:"oidc-authenticating__container",children:[i.jsx("h1",{className:"oidc-authenticating__title",children:"Authentication in progress"}),i.jsx("p",{className:"oidc-authenticating__content",children:"You will be redirected to the login page."})]})}),tt=()=>Math.random().toString(36).substr(2,6),nt=(s,o)=>(n,a)=>{if(typeof s.CustomEvent=="function")return new s.CustomEvent(n,a);const u=a||{bubbles:!1,cancelable:!1,detail:void 0},f=o.createEvent("CustomEvent");return f.initCustomEvent(n,u.bubbles,u.cancelable,u.detail),f.prototype=s.Event.prototype,f},rt=(s,o,n)=>({replaceState:(a,u)=>{const f=n(),_=u||s.history.state;s.history.replaceState({key:f,state:_},null,a),s.dispatchEvent(o("popstate"))}}),st=()=>rt(window,nt(window,document),tt),we=()=>i.jsx("div",{className:"oidc-callback",children:i.jsxs("div",{className:"oidc-callback__container",children:[i.jsx("h1",{className:"oidc-callback__title",children:"Authentication complete"}),i.jsx("p",{className:"oidc-callback__content",children:"You will be redirected to your application."})]})}),ot=({callBackError:s,callBackSuccess:o,configurationName:n,withCustomHistory:a})=>{const[u,f]=g.useState(!1);g.useEffect(()=>{let v=!0;return(async()=>{const m=c.OidcClient.get;try{const{callbackPath:R}=await m(n).loginCallbackAsync();(a?a():st()).replaceState(R||"/")}catch(R){v&&(console.warn(R),f(!0))}})(),()=>{v=!1}},[]);const _=s||Te,l=o||we;return u?i.jsx(_,{configurationName:n}):i.jsx(l,{configurationName:n})},at=()=>i.jsx("span",{className:"oidc-loading",children:"Loading"}),ct=()=>i.jsx("div",{className:"oidc-serviceworker",children:i.jsxs("div",{className:"oidc-serviceworker__container",children:[i.jsx("h1",{className:"oidc-serviceworker__title",children:"Unable to authenticate on this browser"}),i.jsx("p",{className:"oidc-serviceworker__content",children:"Your browser is not secure enough to make authentication work. Try updating your browser or use a newer browser."})]})}),it=()=>i.jsx("div",{className:"oidc-session-lost",children:i.jsxs("div",{className:"oidc-session-lost__container",children:[i.jsx("h1",{className:"oidc-session-lost__title",children:"Session timed out"}),i.jsx("p",{className:"oidc-session-lost__content",children:"Your session has expired. Please re-authenticate."})]})}),lt=({configurationName:s})=>(g.useEffect(()=>{(async()=>{const n=c.OidcClient.get;n(s).silentLoginCallbackAsync()})()},[]),i.jsx(i.Fragment,{})),ut=({configurationName:s})=>{const o=c.getParseQueryStringFromLocation(window.location.href),n=c.OidcClient.get,a=n(s);let u=null;for(const[f,_]of Object.entries(o))f==="state"||f==="scope"||(u===null&&(u={}),u[f]=_);return g.useEffect(()=>{a.tokens||a.loginAsync(null,u,!0,o.scope)},[]),i.jsx(i.Fragment,{})},ft=({callbackErrorComponent:s,callbackSuccessComponent:o,redirect_uri:n,silent_redirect_uri:a,silent_login_uri:u,children:f,configurationName:_,withCustomHistory:l=null,location:v})=>{const b=window?c.getPath(window.location.href):"",[m,R]=g.useState(b);g.useEffect(()=>{const x=()=>R(c.getPath(window.location.href));return x(),window.addEventListener("popstate",x,!1),()=>window.removeEventListener("popstate",x,!1)},[]);const C=c.getPath(n);if(a&&m===c.getPath(a))return i.jsx(lt,{configurationName:_});if(u&&m===c.getPath(u))return i.jsx(ut,{configurationName:_});switch(m){case C:return i.jsx(ot,{callBackError:s,callBackSuccess:o,configurationName:_,withCustomHistory:l});default:return i.jsx(i.Fragment,{children:f})}},dt=g.memo(ft),Re={name:"",data:null},vt=({loadingComponent:s,children:o,configurationName:n})=>{const[a,u]=g.useState(!0),f=c.OidcClient.get,_=f(n);g.useEffect(()=>{let v=!0;return _&&_.tryKeepExistingSessionAsync().then(()=>{v&&u(!1)}),()=>{v=!1}},[n]);const l=s;return i.jsx(i.Fragment,{children:a?i.jsx(l,{configurationName:n}):i.jsx(i.Fragment,{children:o})})},K=({isLoading:s,loadingComponent:o,children:n,configurationName:a})=>{const u=o;return s?i.jsx(u,{configurationName:a,children:n}):i.jsx(i.Fragment,{children:n})},ht=({children:s,configuration:o,configurationName:n="default",callbackSuccessComponent:a=we,authenticatingComponent:u=et,loadingComponent:f=at,serviceWorkerNotSupportedComponent:_=ct,authenticatingErrorComponent:l=Te,sessionLostComponent:v=it,onSessionLost:b=null,onLogoutFromAnotherTab:m=null,onLogoutFromSameTab:R=null,withCustomHistory:C=null,onEvent:x=null,getFetch:X=null,location:Q=null})=>{const W=(D="default")=>c.OidcClient.getOrCreate(X??c.getFetchDefault,Q??new c.OidcLocation)(o,D),[L,S]=g.useState(!0),[oe,Y]=g.useState(Re),[ae,ce]=g.useState("default");g.useEffect(()=>{const V=W(n).subscribeEvents((T,N)=>{x&&x(n,T,N)});return()=>{W(n).removeEventSubscription(V)}},[n,x]),g.useEffect(()=>{const V=W(n).subscribeEvents((T,N)=>{if(T===c.OidcClient.eventNames.refreshTokensAsync_error||T===c.OidcClient.eventNames.syncTokensAsync_error){if(b!=null){b();return}Y({name:T,data:N})}else if(T===c.OidcClient.eventNames.logout_from_another_tab){if(m!=null){m();return}Y({name:T,data:N})}else T===c.OidcClient.eventNames.logout_from_same_tab?R!=null&&R():T===c.OidcClient.eventNames.loginAsync_begin||T===c.OidcClient.eventNames.loginCallbackAsync_end||T===c.OidcClient.eventNames.loginAsync_error||T===c.OidcClient.eventNames.loginCallbackAsync_error?Y({name:T,data:N}):T===c.OidcClient.eventNames.service_worker_not_supported_by_browser&&o.service_worker_only===!0&&Y({name:T,data:N})});return ce(n),S(!1),()=>{W(n).removeEventSubscription(V),Y(Re)}},[o,n]);const ie=v,le=u,F=f,ue=_,fe=l,U=L||ae!==n,P=W(n);switch(oe.name){case c.OidcClient.eventNames.service_worker_not_supported_by_browser:return i.jsx(K,{loadingComponent:F,isLoading:U,configurationName:n,children:i.jsx(ue,{configurationName:n})});case c.OidcClient.eventNames.loginAsync_begin:return i.jsx(K,{loadingComponent:F,isLoading:U,configurationName:n,children:i.jsx(le,{configurationName:n})});case c.OidcClient.eventNames.loginAsync_error:case c.OidcClient.eventNames.loginCallbackAsync_error:return i.jsx(K,{loadingComponent:F,isLoading:U,configurationName:n,children:i.jsx(fe,{configurationName:n})});case c.OidcClient.eventNames.refreshTokensAsync_error:case c.OidcClient.eventNames.syncTokensAsync_error:case c.OidcClient.eventNames.logout_from_another_tab:return i.jsx(K,{loadingComponent:F,isLoading:U,configurationName:n,children:i.jsx(ie,{configurationName:n})});default:return i.jsx(K,{loadingComponent:F,isLoading:U,configurationName:n,children:i.jsx(dt,{redirect_uri:P.configuration.redirect_uri,silent_redirect_uri:P.configuration.silent_redirect_uri,silent_login_uri:P.configuration.silent_login_uri,callbackSuccessComponent:a,callbackErrorComponent:l,authenticatingComponent:u,configurationName:n,withCustomHistory:C,location:Q??new c.OidcLocation,children:i.jsx(vt,{loadingComponent:F,configurationName:n,children:s})})})}},Se=({children:s,callbackPath:o=null,extras:n=null,configurationName:a="default"})=>{const u=c.OidcClient.get,f=u(a);return g.useEffect(()=>{f.tokens||f.loginAsync(o,n)},[a,o,n]),f.tokens?i.jsx(i.Fragment,{children:s}):null},pt=(s,o=null,n=null,a="default")=>u=>i.jsx(Se,{callbackPath:o,extras:n,configurationName:a,children:i.jsx(s,{...u})}),re="default",se=(s,o)=>{let n=!1;return s(o)&&(n=s(o).tokens!=null),n},_t=(s=re)=>{const o=c.OidcClient.get,[n,a]=g.useState(se(o,s));return g.useEffect(()=>{let l=!0;const v=o(s);a(se(o,s));const b=v.subscribeEvents((m,R)=>{(m===c.OidcClient.eventNames.logout_from_another_tab||m===c.OidcClient.eventNames.logout_from_same_tab||m===c.OidcClient.eventNames.token_aquired)&&l&&a(se(o,s))});return()=>{l=!1,v.removeEventSubscription(b)}},[s]),{login:(l=void 0,v=null,b=!1)=>o(s).loginAsync(l,v,!1,void 0,b),logout:(l=void 0,v=null)=>o(s).logoutAsync(l,v),renewTokens:async(l=null)=>{const v=await o(s).renewTokensAsync(l);return{accessToken:v.accessToken,accessTokenPayload:v.accessTokenPayload,idToken:v.idToken,idTokenPayload:v.idTokenPayload}},isAuthenticated:n}},je={accessToken:null,accessTokenPayload:null},gt=s=>{const o=c.OidcClient.get,n=o(s);if(n.tokens){const a=n.tokens;return{accessToken:a.accessToken,accessTokenPayload:a.accessTokenPayload,generateDemonstrationOfProofOfPossessionAsync:n.configuration.demonstrating_proof_of_possession?(u,f)=>n.generateDemonstrationOfProofOfPossessionAsync(a.accessToken,u,f):null}}return je};function yt(s,o){return s.configuration.demonstrating_proof_of_possession?(n,a)=>s.generateDemonstrationOfProofOfPossessionAsync(o.accessToken,n,a):null}const bt=(s=re)=>{const o=c.OidcClient.get,[n,a]=g.useState(gt(s));return g.useEffect(()=>{let u=!0;const f=o(s);if(f.tokens){const l=f.tokens;a({accessToken:l.accessToken,accessTokenPayload:l.accessTokenPayload})}const _=f.subscribeEvents((l,v)=>{if((l===c.OidcClient.eventNames.token_renewed||l===c.OidcClient.eventNames.token_aquired||l===c.OidcClient.eventNames.logout_from_another_tab||l===c.OidcClient.eventNames.logout_from_same_tab||l===c.OidcClient.eventNames.refreshTokensAsync_error||l===c.OidcClient.eventNames.syncTokensAsync_error)&&u){const b=f.tokens;a(b!=null?{accessToken:b.accessToken,accessTokenPayload:b.accessTokenPayload,generateDemonstrationOfProofOfPossessionAsync:yt(f,b)}:je)}});return()=>{u=!1,f.removeEventSubscription(_)}},[s]),n},Pe={idToken:null,idTokenPayload:null},mt=s=>{const o=c.OidcClient.get,n=o(s);if(n.tokens){const a=n.tokens;return{idToken:a.idToken,idTokenPayload:a.idTokenPayload}}return Pe},kt=(s=re)=>{const o=c.OidcClient.get,[n,a]=g.useState(mt(s));return g.useEffect(()=>{let u=!0;const f=o(s);if(f.tokens){const l=f.tokens;a({idToken:l.idToken,idTokenPayload:l.idTokenPayload})}const _=f.subscribeEvents((l,v)=>{if((l===c.OidcClient.eventNames.token_renewed||l===c.OidcClient.eventNames.token_aquired||l===c.OidcClient.eventNames.logout_from_another_tab||l===c.OidcClient.eventNames.logout_from_same_tab||l===c.OidcClient.eventNames.refreshTokensAsync_error||l===c.OidcClient.eventNames.syncTokensAsync_error)&&u){const b=f.tokens;a(b!=null?{idToken:b.idToken,idTokenPayload:b.idTokenPayload}:Pe)}});return()=>{u=!1,f.removeEventSubscription(_)}},[s]),n};var Ce=(s=>(s.Unauthenticated="Unauthenticated",s.Loading="Loading user",s.Loaded="User loaded",s.LoadingError="Error loading user",s))(Ce||{});const Ot=(s="default")=>{const[o,n]=g.useState({user:null,status:"Unauthenticated"}),[a,u]=g.useState("");g.useEffect(()=>{const _=c.OidcClient.get(s);let l=!0;if(_&&_.tokens){n({...o,status:"Loading user"});const b=a!=="";_.userInfoAsync(b).then(m=>{l&&n({user:m,status:"User loaded"})}).catch(()=>n({...o,status:"Error loading user"}))}else n({user:null,status:"Unauthenticated"});const v=_.subscribeEvents((b,m)=>{(b===c.OidcClient.eventNames.logout_from_another_tab||b===c.OidcClient.eventNames.logout_from_same_tab)&&l&&n({user:null,status:"Unauthenticated"})});return()=>{l=!1,_.removeEventSubscription(v)}},[a]);const f=()=>{u(a+" ")};return{oidcUser:o.user,oidcUserLoadingState:o.status,reloadOidcUser:f}};Object.defineProperty(O,"OidcClient",{enumerable:!0,get:()=>c.OidcClient}),Object.defineProperty(O,"OidcLocation",{enumerable:!0,get:()=>c.OidcLocation}),Object.defineProperty(O,"TokenAutomaticRenewMode",{enumerable:!0,get:()=>c.TokenAutomaticRenewMode}),Object.defineProperty(O,"TokenRenewMode",{enumerable:!0,get:()=>c.TokenRenewMode}),O.OidcProvider=ht,O.OidcSecure=Se,O.OidcUserStatus=Ce,O.useOidc=_t,O.useOidcAccessToken=bt,O.useOidcFetch=Ee,O.useOidcIdToken=kt,O.useOidcUser=Ot,O.withOidcFetch=$e,O.withOidcSecure=pt,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axa-fr/react-oidc",
|
|
3
|
-
"version": "7.20.1
|
|
3
|
+
"version": "7.20.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.umd.cjs",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"lint": "eslint src"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@axa-fr/oidc-client-service-worker": "7.20.1
|
|
44
|
-
"@axa-fr/oidc-client": "7.20.1
|
|
43
|
+
"@axa-fr/oidc-client-service-worker": "7.20.1",
|
|
44
|
+
"@axa-fr/oidc-client": "7.20.1"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"react": "^17.0.0 || ^18.0.0"
|
package/src/ReactOidc.tsx
CHANGED
|
@@ -127,11 +127,12 @@ export const useOidcAccessToken = (configurationName = defaultConfigurationName)
|
|
|
127
127
|
return state;
|
|
128
128
|
};
|
|
129
129
|
|
|
130
|
-
const idTokenInitialState = { idToken: null, idTokenPayload: null
|
|
130
|
+
const idTokenInitialState = { idToken: null, idTokenPayload: null};
|
|
131
131
|
|
|
132
132
|
const initIdToken = (configurationName: string) => {
|
|
133
133
|
const getOidc = OidcClient.get;
|
|
134
134
|
const oidc = getOidc(configurationName);
|
|
135
|
+
|
|
135
136
|
if (oidc.tokens) {
|
|
136
137
|
const tokens = oidc.tokens;
|
|
137
138
|
return { idToken: tokens.idToken, idTokenPayload: tokens.idTokenPayload };
|
package/src/index.ts
CHANGED
|
@@ -8,6 +8,6 @@ export type {
|
|
|
8
8
|
Fetch,
|
|
9
9
|
OidcConfiguration,
|
|
10
10
|
StringMap,
|
|
11
|
-
|
|
11
|
+
ILOidcLocation
|
|
12
12
|
} from '@axa-fr/oidc-client';
|
|
13
|
-
export { type OidcUserInfo, TokenRenewMode, OidcClient } from '@axa-fr/oidc-client';
|
|
13
|
+
export { type OidcUserInfo, TokenRenewMode, OidcClient, TokenAutomaticRenewMode, OidcLocation } from '@axa-fr/oidc-client';
|