@axa-fr/react-oidc 6.24.27-beta929 → 6.25.0-alpha939
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/bin/post-install.js +35 -0
- package/dist/FetchToken.d.ts +2 -3
- package/dist/FetchToken.d.ts.map +1 -1
- package/dist/OidcProvider.d.ts +4 -5
- package/dist/OidcProvider.d.ts.map +1 -1
- package/dist/OidcSecure.d.ts +3 -3
- package/dist/OidcSecure.d.ts.map +1 -1
- package/dist/OidcServiceWorker.js +559 -0
- package/{service_worker → dist}/OidcTrustedDomains.js +4 -5
- package/dist/ReactOidc.d.ts +4 -4
- package/dist/ReactOidc.d.ts.map +1 -1
- package/dist/User.d.ts +2 -2
- package/dist/User.d.ts.map +1 -1
- package/dist/core/default-component/AuthenticateError.component.d.ts.map +1 -1
- package/dist/core/default-component/Authenticating.component.d.ts.map +1 -1
- package/dist/core/default-component/Callback.component.d.ts.map +1 -1
- package/dist/core/default-component/Loading.component.d.ts.map +1 -1
- package/dist/core/default-component/ServiceWorkerNotSupported.component.d.ts.map +1 -1
- package/dist/core/default-component/SessionLost.component.d.ts.map +1 -1
- package/dist/core/default-component/SilentCallback.component.d.ts.map +1 -1
- package/dist/core/default-component/SilentLogin.component.d.ts.map +1 -1
- package/dist/core/default-component/index.d.ts.map +1 -1
- package/dist/core/routes/OidcRoutes.d.ts +1 -1
- package/dist/core/routes/OidcRoutes.d.ts.map +1 -1
- package/dist/core/routes/index.d.ts +3 -0
- package/dist/core/routes/index.d.ts.map +1 -0
- package/dist/core/routes/withRouter.d.ts +4 -4
- package/dist/core/routes/withRouter.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +964 -21
- package/dist/index.umd.cjs +27 -0
- package/package.json +37 -43
- package/src/{oidc/FetchToken.tsx → FetchToken.tsx} +14 -16
- package/src/{oidc/OidcProvider.tsx → OidcProvider.tsx} +40 -42
- package/src/{oidc/OidcSecure.tsx → OidcSecure.tsx} +1 -3
- package/src/{oidc/ReactOidc.tsx → ReactOidc.tsx} +1 -3
- package/src/{oidc/User.ts → User.ts} +1 -2
- package/src/{oidc/core → core}/default-component/AuthenticateError.component.tsx +0 -1
- package/src/{oidc/core → core}/default-component/Authenticating.component.tsx +0 -1
- package/src/{oidc/core → core}/default-component/Callback.component.tsx +2 -2
- package/src/{oidc/core → core}/default-component/Loading.component.tsx +0 -1
- package/src/{oidc/core → core}/default-component/ServiceWorkerNotSupported.component.tsx +0 -1
- package/src/{oidc/core → core}/default-component/SessionLost.component.tsx +1 -1
- package/src/{oidc/core → core}/default-component/SilentCallback.component.tsx +1 -2
- package/src/{oidc/core → core}/default-component/SilentLogin.component.tsx +1 -3
- package/src/{oidc/core → core}/routes/OidcRoutes.spec.tsx +3 -2
- package/src/{oidc/core → core}/routes/OidcRoutes.tsx +6 -6
- package/src/{oidc/core → core}/routes/withRouter.spec.tsx +3 -5
- package/src/{oidc/index.ts → index.ts} +7 -2
- package/bin/copy.cjs +0 -43
- package/dist/FetchToken.js +0 -59
- package/dist/FetchToken.js.map +0 -1
- package/dist/OidcProvider.js +0 -134
- package/dist/OidcProvider.js.map +0 -1
- package/dist/OidcSecure.js +0 -25
- package/dist/OidcSecure.js.map +0 -1
- package/dist/ReactOidc.js +0 -156
- package/dist/ReactOidc.js.map +0 -1
- package/dist/User.js +0 -42
- package/dist/User.js.map +0 -1
- package/dist/core/default-component/AuthenticateError.component.js +0 -6
- package/dist/core/default-component/AuthenticateError.component.js.map +0 -1
- package/dist/core/default-component/Authenticating.component.js +0 -6
- package/dist/core/default-component/Authenticating.component.js.map +0 -1
- package/dist/core/default-component/Callback.component.js +0 -54
- package/dist/core/default-component/Callback.component.js.map +0 -1
- package/dist/core/default-component/Loading.component.js +0 -6
- package/dist/core/default-component/Loading.component.js.map +0 -1
- package/dist/core/default-component/ServiceWorkerNotSupported.component.js +0 -6
- package/dist/core/default-component/ServiceWorkerNotSupported.component.js.map +0 -1
- package/dist/core/default-component/SessionLost.component.js +0 -8
- package/dist/core/default-component/SessionLost.component.js.map +0 -1
- package/dist/core/default-component/SilentCallback.component.js +0 -27
- package/dist/core/default-component/SilentCallback.component.js.map +0 -1
- package/dist/core/default-component/SilentLogin.component.js +0 -29
- package/dist/core/default-component/SilentLogin.component.js.map +0 -1
- package/dist/core/default-component/index.js +0 -20
- package/dist/core/default-component/index.js.map +0 -1
- package/dist/core/routes/OidcRoutes.js +0 -64
- package/dist/core/routes/OidcRoutes.js.map +0 -1
- package/dist/core/routes/withRouter.js +0 -31
- package/dist/core/routes/withRouter.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/service_worker/OidcServiceWorker.d.ts +0 -2
- package/dist/service_worker/OidcServiceWorker.d.ts.map +0 -1
- package/dist/service_worker/OidcServiceWorker.js +0 -2
- package/dist/service_worker/OidcServiceWorker.js.map +0 -1
- package/dist/service_worker/constants.d.ts +0 -18
- package/dist/service_worker/constants.d.ts.map +0 -1
- package/dist/service_worker/types.d.ts +0 -87
- package/dist/service_worker/types.d.ts.map +0 -1
- package/dist/service_worker/utils/codeVerifier.d.ts +0 -2
- package/dist/service_worker/utils/codeVerifier.d.ts.map +0 -1
- package/dist/service_worker/utils/domains.d.ts +0 -7
- package/dist/service_worker/utils/domains.d.ts.map +0 -1
- package/dist/service_worker/utils/index.d.ts +0 -6
- package/dist/service_worker/utils/index.d.ts.map +0 -1
- package/dist/service_worker/utils/serializeHeaders.d.ts +0 -3
- package/dist/service_worker/utils/serializeHeaders.d.ts.map +0 -1
- package/dist/service_worker/utils/sleep.d.ts +0 -3
- package/dist/service_worker/utils/sleep.d.ts.map +0 -1
- package/dist/service_worker/utils/strings.d.ts +0 -8
- package/dist/service_worker/utils/strings.d.ts.map +0 -1
- package/dist/service_worker/utils/tokens.d.ts +0 -22
- package/dist/service_worker/utils/tokens.d.ts.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/vanilla/cache.d.ts +0 -3
- package/dist/vanilla/cache.d.ts.map +0 -1
- package/dist/vanilla/cache.js +0 -30
- package/dist/vanilla/cache.js.map +0 -1
- package/dist/vanilla/checkSession.d.ts +0 -4
- package/dist/vanilla/checkSession.d.ts.map +0 -1
- package/dist/vanilla/checkSession.js +0 -73
- package/dist/vanilla/checkSession.js.map +0 -1
- package/dist/vanilla/checkSessionIFrame.d.ts +0 -17
- package/dist/vanilla/checkSessionIFrame.d.ts.map +0 -1
- package/dist/vanilla/checkSessionIFrame.js +0 -73
- package/dist/vanilla/checkSessionIFrame.js.map +0 -1
- package/dist/vanilla/crypto.d.ts +0 -4
- package/dist/vanilla/crypto.d.ts.map +0 -1
- package/dist/vanilla/crypto.js +0 -85
- package/dist/vanilla/crypto.js.map +0 -1
- package/dist/vanilla/events.d.ts +0 -29
- package/dist/vanilla/events.d.ts.map +0 -1
- package/dist/vanilla/events.js +0 -32
- package/dist/vanilla/events.js.map +0 -1
- package/dist/vanilla/index.d.ts +0 -3
- package/dist/vanilla/index.d.ts.map +0 -1
- package/dist/vanilla/index.js +0 -6
- package/dist/vanilla/index.js.map +0 -1
- package/dist/vanilla/initSession.d.ts +0 -22
- package/dist/vanilla/initSession.d.ts.map +0 -1
- package/dist/vanilla/initSession.js +0 -90
- package/dist/vanilla/initSession.js.map +0 -1
- package/dist/vanilla/initWorker.d.ts +0 -30
- package/dist/vanilla/initWorker.d.ts.map +0 -1
- package/dist/vanilla/initWorker.js +0 -317
- package/dist/vanilla/initWorker.js.map +0 -1
- package/dist/vanilla/login.d.ts +0 -8
- package/dist/vanilla/login.d.ts.map +0 -1
- package/dist/vanilla/login.js +0 -175
- package/dist/vanilla/login.js.map +0 -1
- package/dist/vanilla/logout.d.ts +0 -8
- package/dist/vanilla/logout.d.ts.map +0 -1
- package/dist/vanilla/logout.js +0 -118
- package/dist/vanilla/logout.js.map +0 -1
- package/dist/vanilla/oidc.d.ts +0 -101
- package/dist/vanilla/oidc.d.ts.map +0 -1
- package/dist/vanilla/oidc.js +0 -612
- package/dist/vanilla/oidc.js.map +0 -1
- package/dist/vanilla/parseTokens.d.ts +0 -37
- package/dist/vanilla/parseTokens.d.ts.map +0 -1
- package/dist/vanilla/parseTokens.js +0 -167
- package/dist/vanilla/parseTokens.js.map +0 -1
- package/dist/vanilla/renewTokens.d.ts +0 -4
- package/dist/vanilla/renewTokens.d.ts.map +0 -1
- package/dist/vanilla/renewTokens.js +0 -51
- package/dist/vanilla/renewTokens.js.map +0 -1
- package/dist/vanilla/requests.d.ts +0 -33
- package/dist/vanilla/requests.d.ts.map +0 -1
- package/dist/vanilla/requests.js +0 -174
- package/dist/vanilla/requests.js.map +0 -1
- package/dist/vanilla/route-utils.d.ts +0 -13
- package/dist/vanilla/route-utils.d.ts.map +0 -1
- package/dist/vanilla/route-utils.js +0 -71
- package/dist/vanilla/route-utils.js.map +0 -1
- package/dist/vanilla/silentLogin.d.ts +0 -10
- package/dist/vanilla/silentLogin.d.ts.map +0 -1
- package/dist/vanilla/silentLogin.js +0 -144
- package/dist/vanilla/silentLogin.js.map +0 -1
- package/dist/vanilla/timer.d.ts +0 -8
- package/dist/vanilla/timer.d.ts.map +0 -1
- package/dist/vanilla/timer.js +0 -143
- package/dist/vanilla/timer.js.map +0 -1
- package/dist/vanilla/types.d.ts +0 -38
- package/dist/vanilla/types.d.ts.map +0 -1
- package/dist/vanilla/types.js +0 -3
- package/dist/vanilla/types.js.map +0 -1
- package/dist/vanilla/user.d.ts +0 -2
- package/dist/vanilla/user.d.ts.map +0 -1
- package/dist/vanilla/user.js +0 -48
- package/dist/vanilla/user.js.map +0 -1
- package/dist/vanilla/vanillaOidc.d.ts +0 -85
- package/dist/vanilla/vanillaOidc.d.ts.map +0 -1
- package/dist/vanilla/vanillaOidc.js +0 -71
- package/dist/vanilla/vanillaOidc.js.map +0 -1
- package/service_worker/.eslintrc.cjs +0 -18
- package/service_worker/OidcServiceWorker.ts +0 -424
- package/service_worker/constants.ts +0 -32
- package/service_worker/dist/OidcServiceWorker.d.ts +0 -2
- package/service_worker/dist/OidcServiceWorker.d.ts.map +0 -1
- package/service_worker/dist/OidcServiceWorker.js +0 -2
- package/service_worker/dist/OidcServiceWorker.js.map +0 -1
- package/service_worker/dist/constants.d.ts +0 -18
- package/service_worker/dist/constants.d.ts.map +0 -1
- package/service_worker/dist/types.d.ts +0 -87
- package/service_worker/dist/types.d.ts.map +0 -1
- package/service_worker/dist/utils/codeVerifier.d.ts +0 -2
- package/service_worker/dist/utils/codeVerifier.d.ts.map +0 -1
- package/service_worker/dist/utils/domains.d.ts +0 -7
- package/service_worker/dist/utils/domains.d.ts.map +0 -1
- package/service_worker/dist/utils/index.d.ts +0 -6
- package/service_worker/dist/utils/index.d.ts.map +0 -1
- package/service_worker/dist/utils/serializeHeaders.d.ts +0 -3
- package/service_worker/dist/utils/serializeHeaders.d.ts.map +0 -1
- package/service_worker/dist/utils/sleep.d.ts +0 -3
- package/service_worker/dist/utils/sleep.d.ts.map +0 -1
- package/service_worker/dist/utils/strings.d.ts +0 -8
- package/service_worker/dist/utils/strings.d.ts.map +0 -1
- package/service_worker/dist/utils/tokens.d.ts +0 -22
- package/service_worker/dist/utils/tokens.d.ts.map +0 -1
- package/service_worker/tsconfig.json +0 -26
- package/service_worker/types.ts +0 -103
- package/service_worker/utils/__tests__/codeVerifier.spec.ts +0 -14
- package/service_worker/utils/__tests__/domains.spec.ts +0 -90
- package/service_worker/utils/__tests__/serializeHeaders.spec.ts +0 -11
- package/service_worker/utils/__tests__/strings.spec.ts +0 -9
- package/service_worker/utils/__tests__/testHelper.ts +0 -352
- package/service_worker/utils/__tests__/tokens.spec.ts +0 -92
- package/service_worker/utils/codeVerifier.ts +0 -6
- package/service_worker/utils/domains.ts +0 -105
- package/service_worker/utils/index.ts +0 -5
- package/service_worker/utils/serializeHeaders.ts +0 -12
- package/service_worker/utils/sleep.ts +0 -2
- package/service_worker/utils/strings.ts +0 -9
- package/service_worker/utils/tokens.ts +0 -206
- package/src/oidc/vanilla/cache.ts +0 -27
- package/src/oidc/vanilla/checkSession.ts +0 -60
- package/src/oidc/vanilla/checkSessionIFrame.ts +0 -83
- package/src/oidc/vanilla/crypto.ts +0 -61
- package/src/oidc/vanilla/events.ts +0 -29
- package/src/oidc/vanilla/index.ts +0 -2
- package/src/oidc/vanilla/iniWorker.spec.ts +0 -21
- package/src/oidc/vanilla/initSession.ts +0 -90
- package/src/oidc/vanilla/initWorker.ts +0 -321
- package/src/oidc/vanilla/login.ts +0 -174
- package/src/oidc/vanilla/logout.spec.ts +0 -66
- package/src/oidc/vanilla/logout.spec.tsx +0 -64
- package/src/oidc/vanilla/logout.ts +0 -101
- package/src/oidc/vanilla/oidc.ts +0 -614
- package/src/oidc/vanilla/parseTokens.spec.ts +0 -49
- package/src/oidc/vanilla/parseTokens.ts +0 -194
- package/src/oidc/vanilla/renewTokens.ts +0 -37
- package/src/oidc/vanilla/requests.spec.ts +0 -9
- package/src/oidc/vanilla/requests.ts +0 -169
- package/src/oidc/vanilla/route-utils.spec.ts +0 -23
- package/src/oidc/vanilla/route-utils.ts +0 -79
- package/src/oidc/vanilla/silentLogin.ts +0 -144
- package/src/oidc/vanilla/timer.ts +0 -163
- package/src/oidc/vanilla/types.ts +0 -42
- package/src/oidc/vanilla/user.ts +0 -40
- package/src/oidc/vanilla/vanillaOidc.ts +0 -109
- package/src/override/AuthenticateError.component.tsx +0 -15
- package/src/override/Authenticating.component.tsx +0 -15
- package/src/override/Callback.component.tsx +0 -14
- package/src/override/Loading.component.tsx +0 -11
- package/src/override/ServiceWorkerNotSupported.component.tsx +0 -15
- package/src/override/SessionLost.component.tsx +0 -22
- package/src/override/style.ts +0 -12
- /package/src/{oidc/core → core}/default-component/index.ts +0 -0
- /package/src/{oidc/core → core}/routes/__snapshots__/OidcRoutes.spec.tsx.snap +0 -0
- /package/src/{oidc/core → core}/routes/index.ts +0 -0
- /package/src/{oidc/core → core}/routes/withRouter.tsx +0 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
(function(S,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("react"),require("@axa-fr/vanilla-oidc")):typeof define=="function"&&define.amd?define(["exports","react","@axa-fr/vanilla-oidc"],y):(S=typeof globalThis<"u"?globalThis:S||self,y(S["react-oidc"]={},S.React,S.vanillaOidc))})(this,function(S,y,l){"use strict";var ne={exports:{}},G={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var be;function Qe(){if(be)return G;be=1;var s=y,o=Symbol.for("react.element"),n=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,d=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function h(i,v,g){var k,E={},C=null,I=null;g!==void 0&&(C=""+g),v.key!==void 0&&(C=""+v.key),v.ref!==void 0&&(I=v.ref);for(k in v)a.call(v,k)&&!u.hasOwnProperty(k)&&(E[k]=v[k]);if(i&&i.defaultProps)for(k in v=i.defaultProps,v)E[k]===void 0&&(E[k]=v[k]);return{$$typeof:o,type:i,key:C,ref:I,props:E,_owner:d.current}}return G.Fragment=n,G.jsx=h,G.jsxs=h,G}var H={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var ke;function Ze(){return ke||(ke=1,process.env.NODE_ENV!=="production"&&function(){var s=y,o=Symbol.for("react.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),i=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen"),X=Symbol.iterator,U="@@iterator";function oe(e){if(e===null||typeof e!="object")return null;var t=X&&e[X]||e[U];return typeof t=="function"?t:null}var D=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function j(e){{for(var t=arguments.length,r=new Array(t>1?t-1:0),f=1;f<t;f++)r[f-1]=arguments[f];W("error",e,r)}}function W(e,t,r){{var f=D.ReactDebugCurrentFrame,b=f.getStackAddendum();b!==""&&(t+="%s",r=r.concat([b]));var m=r.map(function(_){return String(_)});m.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,m)}}var ae=!1,ce=!1,ie=!1,le=!1,L=!1,Q;Q=Symbol.for("react.module.reference");function ue(e){return!!(typeof e=="string"||typeof e=="function"||e===a||e===u||L||e===d||e===g||e===k||le||e===I||ae||ce||ie||typeof e=="object"&&e!==null&&(e.$$typeof===C||e.$$typeof===E||e.$$typeof===h||e.$$typeof===i||e.$$typeof===v||e.$$typeof===Q||e.getModuleId!==void 0))}function M(e,t,r){var f=e.displayName;if(f)return f;var b=t.displayName||t.name||"";return b!==""?r+"("+b+")":r}function Y(e){return e.displayName||"Context"}function A(e){if(e==null)return null;if(typeof e.tag=="number"&&j("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 u:return"Profiler";case d:return"StrictMode";case g:return"Suspense";case k:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case i:var t=e;return Y(t)+".Consumer";case h:var r=e;return Y(r._context)+".Provider";case v:return M(e,e.render,"ForwardRef");case E:var f=e.displayName||null;return f!==null?f:A(e.type)||"Memo";case C:{var b=e,m=b._payload,_=b._init;try{return A(_(m))}catch{return null}}}return null}var P=Object.assign,V=0,w,F,xe,Pe,Ae,Ve,Fe;function Ne(){}Ne.__reactDisabledLog=!0;function Et(){{if(V===0){w=console.log,F=console.info,xe=console.warn,Pe=console.error,Ae=console.group,Ve=console.groupCollapsed,Fe=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})}V++}}function Tt(){{if(V--,V===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:P({},e,{value:w}),info:P({},e,{value:F}),warn:P({},e,{value:xe}),error:P({},e,{value:Pe}),group:P({},e,{value:Ae}),groupCollapsed:P({},e,{value:Ve}),groupEnd:P({},e,{value:Fe})})}V<0&&j("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var de=D.ReactCurrentDispatcher,fe;function Z(e,t,r){{if(fe===void 0)try{throw Error()}catch(b){var f=b.stack.trim().match(/\n( *(at )?)/);fe=f&&f[1]||""}return`
|
|
18
|
+
`+fe+e}}var ve=!1,q;{var wt=typeof WeakMap=="function"?WeakMap:Map;q=new wt}function Ie(e,t){if(!e||ve)return"";{var r=q.get(e);if(r!==void 0)return r}var f;ve=!0;var b=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var m;m=de.current,de.current=null,Et();try{if(t){var _=function(){throw Error()};if(Object.defineProperty(_.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_,[])}catch(N){f=N}Reflect.construct(e,[],_)}else{try{_.call()}catch(N){f=N}e.call(_.prototype)}}else{try{throw Error()}catch(N){f=N}e()}}catch(N){if(N&&f&&typeof N.stack=="string"){for(var p=N.stack.split(`
|
|
19
|
+
`),O=f.stack.split(`
|
|
20
|
+
`),T=p.length-1,R=O.length-1;T>=1&&R>=0&&p[T]!==O[R];)R--;for(;T>=1&&R>=0;T--,R--)if(p[T]!==O[R]){if(T!==1||R!==1)do if(T--,R--,R<0||p[T]!==O[R]){var x=`
|
|
21
|
+
`+p[T].replace(" at new "," at ");return e.displayName&&x.includes("<anonymous>")&&(x=x.replace("<anonymous>",e.displayName)),typeof e=="function"&&q.set(e,x),x}while(T>=1&&R>=0);break}}}finally{ve=!1,de.current=m,Tt(),Error.prepareStackTrace=b}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 g:return Z("Suspense");case k:return Z("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case v:return Rt(e.render);case E:return $(e.type,t,r);case C:{var f=e,b=f._payload,m=f._init;try{return $(m(b),t,r)}catch{}}}return""}var ee=Object.prototype.hasOwnProperty,De={},Le=D.ReactDebugCurrentFrame;function te(e){if(e){var t=e._owner,r=$(e.type,e._source,t?t.type:null);Le.setExtraStackFrame(r)}else Le.setExtraStackFrame(null)}function Ct(e,t,r,f,b){{var m=Function.call.bind(ee);for(var _ in e)if(m(e,_)){var p=void 0;try{if(typeof e[_]!="function"){var O=Error((f||"React class")+": "+r+" type `"+_+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[_]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw O.name="Invariant Violation",O}p=e[_](t,_,f,r,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(T){p=T}p&&!(p instanceof Error)&&(te(b),j("%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).",f||"React class",r,_,typeof p),te(null)),p instanceof Error&&!(p.message in De)&&(De[p.message]=!0,te(b),j("Failed %s type: %s",r,p.message),te(null))}}}var jt=Array.isArray;function he(e){return jt(e)}function Ot(e){{var t=typeof Symbol=="function"&&Symbol.toStringTag,r=t&&e[Symbol.toStringTag]||e.constructor.name||"Object";return r}}function xt(e){try{return Ue(e),!1}catch{return!0}}function Ue(e){return""+e}function We(e){if(xt(e))return j("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ot(e)),Ue(e)}var K=D.ReactCurrentOwner,Pt={key:!0,ref:!0,__self:!0,__source:!0},Me,Ye,pe;pe={};function At(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 Vt(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 Ft(e,t){if(typeof e.ref=="string"&&K.current&&t&&K.current.stateNode!==t){var r=A(K.current.type);pe[r]||(j('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',A(K.current.type),e.ref),pe[r]=!0)}}function Nt(e,t){{var r=function(){Me||(Me=!0,j("%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 It(e,t){{var r=function(){Ye||(Ye=!0,j("%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 Dt=function(e,t,r,f,b,m,_){var p={$$typeof:o,type:e,key:t,ref:r,props:_,_owner:m};return p._store={},Object.defineProperty(p._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(p,"_self",{configurable:!1,enumerable:!1,writable:!1,value:f}),Object.defineProperty(p,"_source",{configurable:!1,enumerable:!1,writable:!1,value:b}),Object.freeze&&(Object.freeze(p.props),Object.freeze(p)),p};function Lt(e,t,r,f,b){{var m,_={},p=null,O=null;r!==void 0&&(We(r),p=""+r),Vt(t)&&(We(t.key),p=""+t.key),At(t)&&(O=t.ref,Ft(t,b));for(m in t)ee.call(t,m)&&!Pt.hasOwnProperty(m)&&(_[m]=t[m]);if(e&&e.defaultProps){var T=e.defaultProps;for(m in T)_[m]===void 0&&(_[m]=T[m])}if(p||O){var R=typeof e=="function"?e.displayName||e.name||"Unknown":e;p&&Nt(_,R),O&&It(_,R)}return Dt(e,p,O,b,f,K.current,_)}}var _e=D.ReactCurrentOwner,Be=D.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 ge;ge=!1;function ye(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}function ze(){{if(_e.current){var e=A(_e.current.type);if(e)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function Ut(e){{if(e!==void 0){var t=e.fileName.replace(/^.*[\\\/]/,""),r=e.lineNumber;return`
|
|
24
|
+
|
|
25
|
+
Check your code at `+t+":"+r+"."}return""}}var Ge={};function Wt(e){{var t=ze();if(!t){var r=typeof e=="string"?e:e.displayName||e.name;r&&(t=`
|
|
26
|
+
|
|
27
|
+
Check the top-level render call using <`+r+">.")}return t}}function He(e,t){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var r=Wt(t);if(Ge[r])return;Ge[r]=!0;var f="";e&&e._owner&&e._owner!==_e.current&&(f=" It was passed a child from "+A(e._owner.type)+"."),B(e),j('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',r,f),B(null)}}function Je(e,t){{if(typeof e!="object")return;if(he(e))for(var r=0;r<e.length;r++){var f=e[r];ye(f)&&He(f,t)}else if(ye(e))e._store&&(e._store.validated=!0);else if(e){var b=oe(e);if(typeof b=="function"&&b!==e.entries)for(var m=b.call(e),_;!(_=m.next()).done;)ye(_.value)&&He(_.value,t)}}}function Mt(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===E))r=t.propTypes;else return;if(r){var f=A(t);Ct(r,e.props,"prop",f,e)}else if(t.PropTypes!==void 0&&!ge){ge=!0;var b=A(t);j("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",b||"Unknown")}typeof t.getDefaultProps=="function"&&!t.getDefaultProps.isReactClassApproved&&j("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Yt(e){{for(var t=Object.keys(e.props),r=0;r<t.length;r++){var f=t[r];if(f!=="children"&&f!=="key"){B(e),j("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",f),B(null);break}}e.ref!==null&&(B(e),j("Invalid attribute `ref` supplied to `React.Fragment`."),B(null))}}function Ke(e,t,r,f,b,m){{var _=ue(e);if(!_){var p="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(p+=" 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 O=Ut(b);O?p+=O:p+=ze();var T;e===null?T="null":he(e)?T="array":e!==void 0&&e.$$typeof===o?(T="<"+(A(e.type)||"Unknown")+" />",p=" Did you accidentally export a JSX literal instead of a component?"):T=typeof e,j("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",T,p)}var R=Lt(e,t,r,b,m);if(R==null)return R;if(_){var x=t.children;if(x!==void 0)if(f)if(he(x)){for(var z=0;z<x.length;z++)Je(x[z],e);Object.freeze&&Object.freeze(x)}else j("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 Je(x,e)}return e===a?Yt(R):Mt(R),R}}function Bt(e,t,r){return Ke(e,t,r,!0)}function zt(e,t,r){return Ke(e,t,r,!1)}var Gt=zt,Ht=Bt;H.Fragment=a,H.jsx=Gt,H.jsxs=Ht}()),H}process.env.NODE_ENV==="production"?ne.exports=Qe():ne.exports=Ze();var c=ne.exports;const me="default",qe=(s,o)=>async(...n)=>{var C;const[a,d,...u]=n,h=d?{...d}:{method:"GET"};let i=new Headers;h.headers&&(i=h.headers instanceof Headers?h.headers:new Headers(h.headers));const g=await o().getValidTokenAsync(),k=(C=g==null?void 0:g.tokens)==null?void 0:C.accessToken;i.has("Accept")||i.set("Accept","application/json"),k&&(i.set("Authorization",`Bearer ${k}`),h.credentials||(h.credentials="same-origin"));const E={...h,headers:i};return await s(a,E,...u)},$e=(s=null,o=me)=>n=>a=>{const{fetch:d}=Ee(s||a.fetch,o);return c.jsx(n,{...a,fetch:d})},Ee=(s=null,o=me)=>{const n=s||window.fetch,a=l.VanillaOidc.get;return{fetch:y.useCallback((u,h)=>qe(n,()=>a(o))(u,h),[n,o])}},Te=()=>c.jsx("div",{className:"oidc-authenticating",children:c.jsxs("div",{className:"oidc-authenticating__container",children:[c.jsx("h1",{className:"oidc-authenticating__title",children:"Error authentication"}),c.jsx("p",{className:"oidc-authenticating__content",children:"An error occurred during authentication."})]})}),et=()=>c.jsx("div",{className:"oidc-authenticating",children:c.jsxs("div",{className:"oidc-authenticating__container",children:[c.jsx("h1",{className:"oidc-authenticating__title",children:"Authentication in progress"}),c.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 d=a||{bubbles:!1,cancelable:!1,detail:void 0},u=o.createEvent("CustomEvent");return u.initCustomEvent(n,d.bubbles,d.cancelable,d.detail),u.prototype=s.Event.prototype,u},rt=(s,o,n)=>({replaceState:(a,d)=>{const u=n(),h=d||s.history.state;s.history.replaceState({key:u,state:h},null,a),s.dispatchEvent(o("popstate"))}}),st=()=>rt(window,nt(window,document),tt),we=()=>c.jsx("div",{className:"oidc-callback",children:c.jsxs("div",{className:"oidc-callback__container",children:[c.jsx("h1",{className:"oidc-callback__title",children:"Authentication complete"}),c.jsx("p",{className:"oidc-callback__content",children:"You will be redirected to your application."})]})}),ot=({callBackError:s,callBackSuccess:o,configurationName:n,withCustomHistory:a})=>{const[d,u]=y.useState(!1);y.useEffect(()=>{let v=!0;return(async()=>{const k=l.VanillaOidc.get;try{const{callbackPath:E}=await k(n).loginCallbackAsync();(a?a():st()).replaceState(E||"/")}catch(E){v&&(console.warn(E),u(!0))}})(),()=>{v=!1}},[]);const h=s||Te,i=o||we;return d?c.jsx(h,{configurationName:n}):c.jsx(i,{configurationName:n})},at=()=>c.jsx("span",{className:"oidc-loading",children:"Loading"}),ct=()=>c.jsx("div",{className:"oidc-serviceworker",children:c.jsxs("div",{className:"oidc-serviceworker__container",children:[c.jsx("h1",{className:"oidc-serviceworker__title",children:"Unable to authenticate on this browser"}),c.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=()=>c.jsx("div",{className:"oidc-session-lost",children:c.jsxs("div",{className:"oidc-session-lost__container",children:[c.jsx("h1",{className:"oidc-session-lost__title",children:"Session timed out"}),c.jsx("p",{className:"oidc-session-lost__content",children:"Your session has expired. Please re-authenticate."})]})}),lt=({configurationName:s})=>(y.useEffect(()=>{(async()=>{const n=l.VanillaOidc.get;n(s).silentLoginCallbackAsync()})()},[]),c.jsx(c.Fragment,{})),ut=({configurationName:s})=>{const o=l.getParseQueryStringFromLocation(window.location.href),n=l.VanillaOidc.get,a=n(s);let d=null;for(const[u,h]of Object.entries(o))u==="state"||u==="scope"||(d===null&&(d={}),d[u]=h);return y.useEffect(()=>{a.tokens||a.loginAsync(null,d,!0,o.scope)},[]),c.jsx(c.Fragment,{})},dt=({callbackErrorComponent:s,callbackSuccessComponent:o,redirect_uri:n,silent_redirect_uri:a,silent_login_uri:d,children:u,configurationName:h,withCustomHistory:i=null})=>{const v=window?l.getPath(window.location.href):"",[g,k]=y.useState(v);y.useEffect(()=>{const C=()=>k(l.getPath(window.location.href));return C(),window.addEventListener("popstate",C,!1),()=>window.removeEventListener("popstate",C,!1)},[]);const E=l.getPath(n);if(a&&g===l.getPath(a))return c.jsx(lt,{configurationName:h});if(d&&g===l.getPath(d))return c.jsx(ut,{configurationName:h});switch(g){case E:return c.jsx(ot,{callBackError:s,callBackSuccess:o,configurationName:h,withCustomHistory:i});default:return c.jsx(c.Fragment,{children:u})}},ft=y.memo(dt),Re={name:"",data:null},vt=({loadingComponent:s,children:o,configurationName:n})=>{const[a,d]=y.useState(!0),u=l.VanillaOidc.get,h=u(n);y.useEffect(()=>{let v=!0;return h&&h.tryKeepExistingSessionAsync().then(()=>{v&&d(!1)}),()=>{v=!1}},[n]);const i=s;return c.jsx(c.Fragment,{children:a?c.jsx(i,{configurationName:n}):c.jsx(c.Fragment,{children:o})})},J=({isLoading:s,loadingComponent:o,children:n,configurationName:a})=>{const d=o;return s?c.jsx(d,{configurationName:a,children:n}):c.jsx(c.Fragment,{children:n})},ht=({children:s,configuration:o,configurationName:n="default",callbackSuccessComponent:a=we,authenticatingComponent:d=et,loadingComponent:u=at,serviceWorkerNotSupportedComponent:h=ct,authenticatingErrorComponent:i=Te,sessionLostComponent:v=it,onSessionLost:g=null,onLogoutFromAnotherTab:k=null,onLogoutFromSameTab:E=null,withCustomHistory:C=null,onEvent:I=null,getFetch:X=null})=>{const U=(P="default")=>l.VanillaOidc.getOrCreate(X??l.getFetchDefault)(o,P),[oe,D]=y.useState(!0),[j,W]=y.useState(Re),[ae,ce]=y.useState("default");y.useEffect(()=>{const V=U(n).subscribeEvents((w,F)=>{I&&I(n,w,F)});return()=>{U(n).removeEventSubscription(V)}},[n,I]),y.useEffect(()=>{const V=U(n).subscribeEvents((w,F)=>{if(w===l.VanillaOidc.eventNames.refreshTokensAsync_error||w===l.VanillaOidc.eventNames.syncTokensAsync_error){if(g!=null){g();return}W({name:w,data:F})}else if(w===l.VanillaOidc.eventNames.logout_from_another_tab){if(k!=null){k();return}W({name:w,data:F})}else w===l.VanillaOidc.eventNames.logout_from_same_tab?E!=null&&E():w===l.VanillaOidc.eventNames.loginAsync_begin||w===l.VanillaOidc.eventNames.loginCallbackAsync_end||w===l.VanillaOidc.eventNames.loginAsync_error||w===l.VanillaOidc.eventNames.loginCallbackAsync_error?W({name:w,data:F}):w===l.VanillaOidc.eventNames.service_worker_not_supported_by_browser&&o.service_worker_only===!0&&W({name:w,data:F})});return ce(n),D(!1),()=>{U(n).removeEventSubscription(V),W(Re)}},[o,n]);const ie=v,le=d,L=u,Q=h,ue=i,M=oe||ae!==n,Y=U(n);switch(j.name){case l.VanillaOidc.eventNames.service_worker_not_supported_by_browser:return c.jsx(J,{loadingComponent:L,isLoading:M,configurationName:n,children:c.jsx(Q,{configurationName:n})});case l.VanillaOidc.eventNames.loginAsync_begin:return c.jsx(J,{loadingComponent:L,isLoading:M,configurationName:n,children:c.jsx(le,{configurationName:n})});case l.VanillaOidc.eventNames.loginAsync_error:case l.VanillaOidc.eventNames.loginCallbackAsync_error:return c.jsx(J,{loadingComponent:L,isLoading:M,configurationName:n,children:c.jsx(ue,{configurationName:n})});case l.VanillaOidc.eventNames.refreshTokensAsync_error:case l.VanillaOidc.eventNames.syncTokensAsync_error:case l.VanillaOidc.eventNames.logout_from_another_tab:return c.jsx(J,{loadingComponent:L,isLoading:M,configurationName:n,children:c.jsx(ie,{configurationName:n})});default:return c.jsx(J,{loadingComponent:L,isLoading:M,configurationName:n,children:c.jsx(ft,{redirect_uri:Y.configuration.redirect_uri,silent_redirect_uri:Y.configuration.silent_redirect_uri,silent_login_uri:Y.configuration.silent_login_uri,callbackSuccessComponent:a,callbackErrorComponent:i,authenticatingComponent:d,configurationName:n,withCustomHistory:C,children:c.jsx(vt,{loadingComponent:L,configurationName:n,children:s})})})}},Se=({children:s,callbackPath:o=null,extras:n=null,configurationName:a="default"})=>{const d=l.VanillaOidc.get,u=d(a);return y.useEffect(()=>{u.tokens||u.loginAsync(o,n)},[a,o,n]),u.tokens?c.jsx(c.Fragment,{children:s}):null},pt=(s,o=null,n=null,a="default")=>d=>c.jsx(Se,{callbackPath:o,extras:n,configurationName:a,children:c.jsx(s,{...d})}),re="default",se=(s,o)=>{let n=!1;return s(o)&&(n=s(o).tokens!=null),n},_t=(s=re)=>{const o=l.VanillaOidc.get,[n,a]=y.useState(se(o,s));return y.useEffect(()=>{let i=!0;const v=o(s);a(se(o,s));const g=v.subscribeEvents((k,E)=>{(k===l.VanillaOidc.eventNames.logout_from_another_tab||k===l.VanillaOidc.eventNames.logout_from_same_tab||k===l.VanillaOidc.eventNames.token_aquired)&&i&&a(se(o,s))});return()=>{i=!1,v.removeEventSubscription(g)}},[s]),{login:(i=void 0,v=null,g=!1)=>o(s).loginAsync(i,v,!1,void 0,g),logout:(i=void 0,v=null)=>o(s).logoutAsync(i,v),renewTokens:async(i=null)=>{const v=await o(s).renewTokensAsync(i);return{accessToken:v.accessToken,accessTokenPayload:v.accessTokenPayload,idToken:v.idToken,idTokenPayload:v.idTokenPayload}},isAuthenticated:n}},Ce={accessToken:null,accessTokenPayload:null},gt=s=>{const o=l.VanillaOidc.get,n=o(s);if(n.tokens){const a=n.tokens;return{accessToken:a.accessToken,accessTokenPayload:a.accessTokenPayload}}return Ce},yt=(s=re)=>{const o=l.VanillaOidc.get,[n,a]=y.useState(gt(s));return y.useEffect(()=>{let d=!0;const u=o(s);if(u.tokens){const i=u.tokens;a({accessToken:i.accessToken,accessTokenPayload:i.accessTokenPayload})}const h=u.subscribeEvents((i,v)=>{if((i===l.VanillaOidc.eventNames.token_renewed||i===l.VanillaOidc.eventNames.token_aquired||i===l.VanillaOidc.eventNames.logout_from_another_tab||i===l.VanillaOidc.eventNames.logout_from_same_tab||i===l.VanillaOidc.eventNames.refreshTokensAsync_error||i===l.VanillaOidc.eventNames.syncTokensAsync_error)&&d){const g=u.tokens;a(g!=null?{accessToken:g.accessToken,accessTokenPayload:g.accessTokenPayload}:Ce)}});return()=>{d=!1,u.removeEventSubscription(h)}},[s]),n},je={idToken:null,idTokenPayload:null},bt=s=>{const o=l.VanillaOidc.get,n=o(s);if(n.tokens){const a=n.tokens;return{idToken:a.idToken,idTokenPayload:a.idTokenPayload}}return je},kt=(s=re)=>{const o=l.VanillaOidc.get,[n,a]=y.useState(bt(s));return y.useEffect(()=>{let d=!0;const u=o(s);if(u.tokens){const i=u.tokens;a({idToken:i.idToken,idTokenPayload:i.idTokenPayload})}const h=u.subscribeEvents((i,v)=>{if((i===l.VanillaOidc.eventNames.token_renewed||i===l.VanillaOidc.eventNames.token_aquired||i===l.VanillaOidc.eventNames.logout_from_another_tab||i===l.VanillaOidc.eventNames.logout_from_same_tab||i===l.VanillaOidc.eventNames.refreshTokensAsync_error||i===l.VanillaOidc.eventNames.syncTokensAsync_error)&&d){const g=u.tokens;a(g!=null?{idToken:g.idToken,idTokenPayload:g.idTokenPayload}:je)}});return()=>{d=!1,u.removeEventSubscription(h)}},[s]),n};var Oe=(s=>(s.Unauthenticated="Unauthenticated",s.Loading="Loading user",s.Loaded="User loaded",s.LoadingError="Error loading user",s))(Oe||{});const mt=(s="default")=>{const[o,n]=y.useState({user:null,status:"Unauthenticated"}),[a,d]=y.useState(""),u=l.VanillaOidc.get(s);y.useEffect(()=>{let i=!0;if(u&&u.tokens){n({...o,status:"Loading user"});const v=a!=="";u.userInfoAsync(v).then(g=>{i&&n({user:g,status:"User loaded"})}).catch(()=>n({...o,status:"Error loading user"}))}else n({user:null,status:"Unauthenticated"});return()=>{i=!1}},[a]);const h=()=>{d(a+" ")};return{oidcUser:o.user,oidcUserLoadingState:o.status,reloadOidcUser:h}};Object.defineProperty(S,"TokenRenewMode",{enumerable:!0,get:()=>l.TokenRenewMode}),S.OidcProvider=ht,S.OidcSecure=Se,S.OidcUserStatus=Oe,S.useOidc=_t,S.useOidcAccessToken=yt,S.useOidcFetch=Ee,S.useOidcIdToken=kt,S.useOidcUser=mt,S.withOidcFetch=$e,S.withOidcSecure=pt,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axa-fr/react-oidc",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.25.0-alpha939",
|
|
4
4
|
"private": false,
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.umd.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
8
9
|
"description": "OpenID Connect & OAuth authentication using react",
|
|
9
10
|
"repository": {
|
|
10
11
|
"type": "git",
|
|
@@ -13,12 +14,9 @@
|
|
|
13
14
|
"files": [
|
|
14
15
|
"dist",
|
|
15
16
|
"bin",
|
|
16
|
-
"src
|
|
17
|
-
"src/override",
|
|
18
|
-
"service_worker",
|
|
17
|
+
"src",
|
|
19
18
|
"README.md",
|
|
20
|
-
"package.json"
|
|
21
|
-
"package-lock.json"
|
|
19
|
+
"package.json"
|
|
22
20
|
],
|
|
23
21
|
"keywords": [
|
|
24
22
|
"oidc",
|
|
@@ -31,56 +29,52 @@
|
|
|
31
29
|
"next"
|
|
32
30
|
],
|
|
33
31
|
"scripts": {
|
|
34
|
-
"copy
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
32
|
+
"copy-service-worker": "cpy ./node_modules/@axa-fr/oidc-client-service-worker/dist/* ./dist --flat",
|
|
33
|
+
"start": "pnpm run copy-service-worker && vite",
|
|
34
|
+
"build": "vite build",
|
|
35
|
+
"serve": "vite preview",
|
|
38
36
|
"test": "vitest --root . --coverage",
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"test:service-worker": "vitest --root ./service_worker --coverage",
|
|
43
|
-
"build:service-worker": "tsc -p ./service_worker/tsconfig.json && vite build ./service_worker --config ./vite.serviceWorker.config.js",
|
|
44
|
-
"prepare": "npm run clean && tsc --build \"./tsconfig.json\" && npm run build && npm run copy:dist",
|
|
37
|
+
"clean": "rimraf dist",
|
|
38
|
+
"postinstall": "node ./bin/post-install.js",
|
|
39
|
+
"prepare": "pnpm run clean && pnpm run copy-service-worker && pnpm run build",
|
|
45
40
|
"lint": "eslint src"
|
|
46
41
|
},
|
|
47
42
|
"dependencies": {
|
|
48
|
-
"
|
|
43
|
+
"@axa-fr/oidc-client-service-worker": "workspace:*",
|
|
44
|
+
"@axa-fr/vanilla-oidc": "workspace:*"
|
|
49
45
|
},
|
|
50
46
|
"peerDependencies": {
|
|
51
47
|
"react": "^17.0.0 || ^18.0.0",
|
|
52
|
-
"react-dom": "^17.0.0 || ^18.0.0"
|
|
48
|
+
"react-dom": "^17.0.0 || ^18.0.0",
|
|
49
|
+
"react-router-dom": "^6.0.0"
|
|
53
50
|
},
|
|
54
51
|
"devDependencies": {
|
|
55
|
-
"@craco/craco": "^7.1.0",
|
|
56
|
-
"@craco/types": "^7.1.0",
|
|
57
52
|
"@testing-library/jest-dom": "5.16.5",
|
|
58
53
|
"@testing-library/react": "13.3.0",
|
|
59
54
|
"@testing-library/user-event": "14.4.3",
|
|
60
|
-
"@types/react": "^18.
|
|
61
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
62
|
-
"@typescript-eslint/parser": "^5.
|
|
63
|
-
"@vitejs/plugin-react": "4.0.
|
|
64
|
-
"@vitest/coverage-
|
|
65
|
-
"
|
|
66
|
-
"
|
|
55
|
+
"@types/react": "^18.2.15",
|
|
56
|
+
"@typescript-eslint/eslint-plugin": "^5.50.0",
|
|
57
|
+
"@typescript-eslint/parser": "^5.50.0",
|
|
58
|
+
"@vitejs/plugin-react": "4.0.3",
|
|
59
|
+
"@vitest/coverage-v8": "^0.33.0",
|
|
60
|
+
"cpy": "^10.1.0",
|
|
61
|
+
"cpy-cli": "^5.0.0",
|
|
67
62
|
"cross-env": "^7.0.3",
|
|
68
63
|
"eslint": "^8.26.0",
|
|
69
|
-
"eslint-config-standard": "^17.
|
|
70
|
-
"eslint-config-standard-with-typescript": "^
|
|
71
|
-
"eslint-import-resolver-typescript": "^3.5.
|
|
72
|
-
"eslint-plugin-react": "^7.
|
|
73
|
-
"eslint-plugin-simple-import-sort": "^
|
|
74
|
-
"jsdom": "
|
|
75
|
-
"msw": "1.2.
|
|
64
|
+
"eslint-config-standard": "^17.1.0",
|
|
65
|
+
"eslint-config-standard-with-typescript": "^36.1.0",
|
|
66
|
+
"eslint-import-resolver-typescript": "^3.5.5",
|
|
67
|
+
"eslint-plugin-react": "^7.32.2",
|
|
68
|
+
"eslint-plugin-simple-import-sort": "^10.0.0",
|
|
69
|
+
"jsdom": "22.1.0",
|
|
70
|
+
"msw": "1.2.2",
|
|
76
71
|
"react": "^18.2.0",
|
|
77
72
|
"react-dom": "^18.2.0",
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"vite": "^
|
|
82
|
-
"
|
|
83
|
-
"vitest": "^0.29.2"
|
|
73
|
+
"rimraf": "5.0.1",
|
|
74
|
+
"typescript": "5.1.6",
|
|
75
|
+
"vite": "^4.4.4",
|
|
76
|
+
"vite-plugin-dts": "^3.3.0",
|
|
77
|
+
"vitest": "^0.33.0"
|
|
84
78
|
},
|
|
85
79
|
"license": "MIT",
|
|
86
80
|
"publishConfig": {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
+
import { Fetch, VanillaOidc } from '@axa-fr/vanilla-oidc';
|
|
1
2
|
import { useCallback } from 'react';
|
|
2
3
|
|
|
3
|
-
import { Fetch } from './vanilla';
|
|
4
|
-
import { VanillaOidc } from './vanilla/vanillaOidc.js';
|
|
5
|
-
|
|
6
4
|
export interface ComponentWithOidcFetchProps {
|
|
7
5
|
fetch?: Fetch;
|
|
8
6
|
}
|
|
@@ -16,8 +14,8 @@ const fetchWithToken = (fetch: Fetch, getOidcWithConfigurationName: () => Vanill
|
|
|
16
14
|
let headers = new Headers();
|
|
17
15
|
if (optionTmp.headers) {
|
|
18
16
|
headers = !(optionTmp.headers instanceof Headers)
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
? new Headers(optionTmp.headers)
|
|
18
|
+
: optionTmp.headers;
|
|
21
19
|
}
|
|
22
20
|
const oidc = getOidcWithConfigurationName();
|
|
23
21
|
|
|
@@ -39,23 +37,23 @@ const fetchWithToken = (fetch: Fetch, getOidcWithConfigurationName: () => Vanill
|
|
|
39
37
|
};
|
|
40
38
|
|
|
41
39
|
export const withOidcFetch = (fetch: Fetch = null, configurationName = defaultConfigurationName) => (
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
WrappedComponent,
|
|
41
|
+
) => (props: ComponentWithOidcFetchProps) => {
|
|
42
|
+
const { fetch: newFetch } = useOidcFetch(fetch || props.fetch, configurationName);
|
|
43
|
+
return <WrappedComponent {...props} fetch={newFetch} />;
|
|
44
|
+
};
|
|
47
45
|
|
|
48
46
|
export const useOidcFetch = (fetch: Fetch = null, configurationName = defaultConfigurationName) => {
|
|
49
47
|
const previousFetch = fetch || window.fetch;
|
|
50
48
|
const getOidc = VanillaOidc.get;
|
|
51
49
|
|
|
52
50
|
const memoizedFetchCallback = useCallback(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
51
|
+
(input: RequestInfo | URL, init?: RequestInit) => {
|
|
52
|
+
const getOidcWithConfigurationName = () => getOidc(configurationName);
|
|
53
|
+
const newFetch = fetchWithToken(previousFetch, getOidcWithConfigurationName);
|
|
54
|
+
return newFetch(input, init);
|
|
55
|
+
},
|
|
56
|
+
[previousFetch, configurationName],
|
|
59
57
|
);
|
|
60
58
|
return { fetch: memoizedFetchCallback };
|
|
61
59
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Fetch, getFetchDefault, OidcConfiguration, VanillaOidc } from '@axa-fr/vanilla-oidc';
|
|
1
2
|
import { ComponentType, FC, PropsWithChildren, useEffect, useState } from 'react';
|
|
2
3
|
|
|
3
4
|
import AuthenticatingError from './core/default-component/AuthenticateError.component.js';
|
|
@@ -5,9 +6,6 @@ import { Authenticating, CallBackSuccess, Loading, SessionLost } from './core/de
|
|
|
5
6
|
import ServiceWorkerNotSupported from './core/default-component/ServiceWorkerNotSupported.component.js';
|
|
6
7
|
import OidcRoutes from './core/routes/OidcRoutes.js';
|
|
7
8
|
import { CustomHistory } from './core/routes/withRouter.js';
|
|
8
|
-
import { getFetchDefault } from './vanilla/oidc';
|
|
9
|
-
import { Fetch, OidcConfiguration } from './vanilla/types.js';
|
|
10
|
-
import { VanillaOidc } from './vanilla/vanillaOidc.js';
|
|
11
9
|
|
|
12
10
|
export type oidcContext = {
|
|
13
11
|
(name?: string): VanillaOidc;
|
|
@@ -29,8 +27,8 @@ export type OidcProviderProps = {
|
|
|
29
27
|
onLogoutFromAnotherTab?: () => void;
|
|
30
28
|
onLogoutFromSameTab?: () => void;
|
|
31
29
|
withCustomHistory?: () => CustomHistory;
|
|
32
|
-
onEvent?: (configuration: string, name: string, data:any) => void;
|
|
33
|
-
getFetch
|
|
30
|
+
onEvent?: (configuration: string, name: string, data: any) => void;
|
|
31
|
+
getFetch?: () => Fetch;
|
|
34
32
|
};
|
|
35
33
|
|
|
36
34
|
export type OidcSessionProps = {
|
|
@@ -38,7 +36,7 @@ export type OidcSessionProps = {
|
|
|
38
36
|
loadingComponent: PropsWithChildren<any>;
|
|
39
37
|
};
|
|
40
38
|
|
|
41
|
-
const OidcSession
|
|
39
|
+
const OidcSession: FC<PropsWithChildren<OidcSessionProps>> = ({ loadingComponent, children, configurationName }) => {
|
|
42
40
|
const [isLoading, setIsLoading] = useState(true);
|
|
43
41
|
const getOidc = VanillaOidc.get;
|
|
44
42
|
const oidc = getOidc(configurationName);
|
|
@@ -54,18 +52,18 @@ const OidcSession : FC<PropsWithChildren<OidcSessionProps>> = ({ loadingComponen
|
|
|
54
52
|
return () => {
|
|
55
53
|
isMounted = false;
|
|
56
54
|
};
|
|
57
|
-
|
|
55
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
58
56
|
}, [configurationName]);
|
|
59
57
|
const LoadingComponent = loadingComponent;
|
|
60
58
|
return (
|
|
61
59
|
<>
|
|
62
60
|
{isLoading
|
|
63
|
-
? (
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
: (
|
|
67
|
-
|
|
68
|
-
|
|
61
|
+
? (
|
|
62
|
+
<LoadingComponent configurationName={configurationName} />
|
|
63
|
+
)
|
|
64
|
+
: (
|
|
65
|
+
<>{children}</>
|
|
66
|
+
)}
|
|
69
67
|
</>
|
|
70
68
|
);
|
|
71
69
|
};
|
|
@@ -78,23 +76,23 @@ const Switch = ({ isLoading, loadingComponent, children, configurationName }) =>
|
|
|
78
76
|
return <>{children}</>;
|
|
79
77
|
};
|
|
80
78
|
|
|
81
|
-
export const OidcProvider
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
79
|
+
export const OidcProvider: FC<PropsWithChildren<OidcProviderProps>> = ({
|
|
80
|
+
children,
|
|
81
|
+
configuration,
|
|
82
|
+
configurationName = 'default',
|
|
83
|
+
callbackSuccessComponent = CallBackSuccess,
|
|
84
|
+
authenticatingComponent = Authenticating,
|
|
85
|
+
loadingComponent = Loading,
|
|
86
|
+
serviceWorkerNotSupportedComponent = ServiceWorkerNotSupported,
|
|
87
|
+
authenticatingErrorComponent = AuthenticatingError,
|
|
88
|
+
sessionLostComponent = SessionLost,
|
|
89
|
+
onSessionLost = null,
|
|
90
|
+
onLogoutFromAnotherTab = null,
|
|
91
|
+
onLogoutFromSameTab = null,
|
|
92
|
+
withCustomHistory = null,
|
|
93
|
+
onEvent = null,
|
|
94
|
+
getFetch = null,
|
|
95
|
+
}) => {
|
|
98
96
|
const getOidc = (configurationName = 'default') => {
|
|
99
97
|
return VanillaOidc.getOrCreate(getFetch ?? getFetchDefault)(configuration, configurationName);
|
|
100
98
|
};
|
|
@@ -154,7 +152,7 @@ export const OidcProvider : FC<PropsWithChildren<OidcProviderProps>> = ({
|
|
|
154
152
|
previousOidc.removeEventSubscription(newSubscriptionId);
|
|
155
153
|
setEvent(defaultEventState);
|
|
156
154
|
};
|
|
157
|
-
|
|
155
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
158
156
|
}, [configuration, configurationName]);
|
|
159
157
|
|
|
160
158
|
const SessionLostComponent = sessionLostComponent;
|
|
@@ -189,18 +187,18 @@ export const OidcProvider : FC<PropsWithChildren<OidcProviderProps>> = ({
|
|
|
189
187
|
default:
|
|
190
188
|
return (
|
|
191
189
|
<Switch loadingComponent={LoadingComponent} isLoading={isLoading} configurationName={configurationName}>
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
190
|
+
<OidcRoutes redirect_uri={oidc.configuration.redirect_uri}
|
|
191
|
+
silent_redirect_uri={oidc.configuration.silent_redirect_uri}
|
|
192
|
+
silent_login_uri={oidc.configuration.silent_login_uri}
|
|
193
|
+
callbackSuccessComponent={callbackSuccessComponent}
|
|
194
|
+
callbackErrorComponent={authenticatingErrorComponent}
|
|
195
|
+
authenticatingComponent={authenticatingComponent}
|
|
196
|
+
configurationName={configurationName}
|
|
197
|
+
withCustomHistory={withCustomHistory}>
|
|
198
|
+
<OidcSession loadingComponent={LoadingComponent} configurationName={configurationName}>
|
|
201
199
|
{children}
|
|
202
|
-
|
|
203
|
-
|
|
200
|
+
</OidcSession>
|
|
201
|
+
</OidcRoutes>
|
|
204
202
|
</Switch>
|
|
205
203
|
);
|
|
206
204
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
+
import { StringMap, VanillaOidc } from '@axa-fr/vanilla-oidc';
|
|
1
2
|
import { FC, PropsWithChildren, useEffect } from 'react';
|
|
2
3
|
|
|
3
|
-
import { StringMap } from './vanilla/types.js';
|
|
4
|
-
import { VanillaOidc } from './vanilla/vanillaOidc.js';
|
|
5
|
-
|
|
6
4
|
export type OidcSecureProps = {
|
|
7
5
|
callbackPath?:string;
|
|
8
6
|
extras?:StringMap;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
+
import { StringMap, VanillaOidc } from '@axa-fr/vanilla-oidc';
|
|
1
2
|
import { useEffect, useState } from 'react';
|
|
2
3
|
|
|
3
|
-
import { StringMap } from './vanilla/types.js';
|
|
4
|
-
import { VanillaOidc } from './vanilla/vanillaOidc.js';
|
|
5
|
-
|
|
6
4
|
const defaultConfigurationName = 'default';
|
|
7
5
|
|
|
8
6
|
type GetOidcFn = {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
+
import { type OidcUserInfo, VanillaOidc } from '@axa-fr/vanilla-oidc';
|
|
1
2
|
import { useEffect, useState } from 'react';
|
|
2
3
|
|
|
3
|
-
import { OidcUserInfo, VanillaOidc } from './vanilla/vanillaOidc.js';
|
|
4
|
-
|
|
5
4
|
export enum OidcUserStatus {
|
|
6
5
|
Unauthenticated= 'Unauthenticated',
|
|
7
6
|
Loading = 'Loading user',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { VanillaOidc } from '@axa-fr/vanilla-oidc';
|
|
2
|
+
import { ComponentType, useEffect, useState } from 'react';
|
|
2
3
|
|
|
3
|
-
import { VanillaOidc } from '../../vanilla/vanillaOidc.js';
|
|
4
4
|
import { getCustomHistory } from '../routes/withRouter.js';
|
|
5
5
|
import AuthenticatingError from './AuthenticateError.component.js';
|
|
6
6
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
+
import { VanillaOidc } from '@axa-fr/vanilla-oidc';
|
|
1
2
|
import { ComponentType, useEffect } from 'react';
|
|
2
3
|
|
|
3
|
-
import { VanillaOidc } from '../../vanilla/vanillaOidc.js';
|
|
4
|
-
|
|
5
4
|
const SilentCallbackManager: ComponentType<any> = ({ configurationName }) => {
|
|
6
5
|
useEffect(() => {
|
|
7
6
|
const playCallbackAsync = async () => {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
+
import { getParseQueryStringFromLocation, VanillaOidc } from '@axa-fr/vanilla-oidc';
|
|
1
2
|
import { ComponentType, useEffect } from 'react';
|
|
2
3
|
|
|
3
|
-
import { getParseQueryStringFromLocation } from '../../vanilla/route-utils.js';
|
|
4
|
-
import { VanillaOidc } from '../../vanilla/vanillaOidc.js';
|
|
5
|
-
|
|
6
4
|
const SilentLogin: ComponentType<any> = ({ configurationName }) => {
|
|
7
5
|
const queryParams = getParseQueryStringFromLocation(window.location.href);
|
|
8
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import OidcRoutes from './OidcRoutes';
|
|
3
|
-
import {render} from "@testing-library/react";
|
|
3
|
+
import { render } from "@testing-library/react";
|
|
4
4
|
import { describe, it, expect } from 'vitest';
|
|
5
5
|
|
|
6
6
|
describe('Authenticating test suite', () => {
|
|
@@ -9,6 +9,7 @@ describe('Authenticating test suite', () => {
|
|
|
9
9
|
children: 'http://url.com',
|
|
10
10
|
callbackComponent: () => <div>tcallback component</div>,
|
|
11
11
|
redirect_uri: 'http://example.com:3000/authentication/callback',
|
|
12
|
+
configurationName: ''
|
|
12
13
|
};
|
|
13
14
|
const { asFragment } = render(<OidcRoutes {...props} />);
|
|
14
15
|
expect(asFragment()).toMatchSnapshot();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { getPath } from '@axa-fr/vanilla-oidc';
|
|
1
2
|
import React, { ComponentType, FC, PropsWithChildren, useEffect, useState } from 'react';
|
|
2
3
|
|
|
3
|
-
import { getPath } from '../../vanilla/route-utils.js';
|
|
4
4
|
import CallbackComponent from '../default-component/Callback.component.js';
|
|
5
5
|
import SilentCallbackComponent from '../default-component/SilentCallback.component.js';
|
|
6
6
|
import SilentLoginComponent from '../default-component/SilentLogin.component.js';
|
|
@@ -10,19 +10,19 @@ type OidcRoutesProps = {
|
|
|
10
10
|
callbackSuccessComponent?: ComponentType;
|
|
11
11
|
callbackErrorComponent?: ComponentType;
|
|
12
12
|
authenticatingComponent?: ComponentType;
|
|
13
|
-
configurationName:string;
|
|
13
|
+
configurationName: string;
|
|
14
14
|
redirect_uri: string;
|
|
15
15
|
silent_redirect_uri?: string;
|
|
16
|
-
silent_login_uri?:string;
|
|
16
|
+
silent_login_uri?: string;
|
|
17
17
|
withCustomHistory?: () => CustomHistory;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
const OidcRoutes: FC<PropsWithChildren<OidcRoutesProps>> = ({
|
|
21
21
|
callbackErrorComponent,
|
|
22
22
|
callbackSuccessComponent,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
redirect_uri,
|
|
24
|
+
silent_redirect_uri,
|
|
25
|
+
silent_login_uri,
|
|
26
26
|
children, configurationName,
|
|
27
27
|
withCustomHistory = null,
|
|
28
28
|
}) => {
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { CreateEvent, WindowInternal } from './withRouter';
|
|
3
|
-
import { describe, it, expect, vi } from 'vitest';
|
|
2
|
+
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
4
3
|
|
|
5
4
|
describe('WithRouter test Suite', () => {
|
|
6
|
-
const generateKeyMock = () => '123ABC';
|
|
7
5
|
const paramsMock = { bubbles: false, cancelable: false, detail: 'detail' };
|
|
8
|
-
beforeEach(() => {});
|
|
6
|
+
beforeEach(() => { });
|
|
9
7
|
it('should CreateEvent return correct Event if not on IE', () => {
|
|
10
8
|
const windowMock = {
|
|
11
9
|
CustomEvent: vi.fn().mockImplementation((event, params) => {
|
|
@@ -44,5 +42,5 @@ describe('WithRouter test Suite', () => {
|
|
|
44
42
|
expect(documentMock.createEvent).toHaveBeenCalledWith('CustomEvent');
|
|
45
43
|
expect(evtMock.initCustomEvent).toHaveBeenCalledWith('event test', false, false, 'detail');
|
|
46
44
|
});
|
|
47
|
-
|
|
45
|
+
|
|
48
46
|
});
|
|
@@ -3,5 +3,10 @@ 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 {
|
|
7
|
-
|
|
6
|
+
export type {
|
|
7
|
+
AuthorityConfiguration,
|
|
8
|
+
Fetch,
|
|
9
|
+
OidcConfiguration,
|
|
10
|
+
StringMap,
|
|
11
|
+
} from '@axa-fr/vanilla-oidc';
|
|
12
|
+
export { type OidcUserInfo, TokenRenewMode } from '@axa-fr/vanilla-oidc';
|
package/bin/copy.cjs
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const fs = require('fs');
|
|
3
|
-
|
|
4
|
-
const applyCopy=(input) => {
|
|
5
|
-
try {
|
|
6
|
-
const destinationPath = path.join(__dirname, input);
|
|
7
|
-
if (fs.existsSync(destinationPath)) {
|
|
8
|
-
const serviceworkerFilename = "OidcServiceWorker.js";
|
|
9
|
-
const serviceWorkerDestinationPath = path.join(destinationPath, serviceworkerFilename);
|
|
10
|
-
if (fs.existsSync(serviceWorkerDestinationPath)) {
|
|
11
|
-
fs.unlinkSync(serviceWorkerDestinationPath);
|
|
12
|
-
}
|
|
13
|
-
const serviceworkerFilePath = path.join(__dirname, "..", "dist/service_worker", serviceworkerFilename);
|
|
14
|
-
if (fs.existsSync(serviceworkerFilePath)) {
|
|
15
|
-
fs.copyFileSync(serviceworkerFilePath, serviceWorkerDestinationPath);
|
|
16
|
-
console.log(`File copied successfully at ${serviceWorkerDestinationPath}`);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const trustedDomainsFilename = "OidcTrustedDomains.js";
|
|
20
|
-
const trustedDomainsDestinationPath = path.join(destinationPath, `${trustedDomainsFilename}`);
|
|
21
|
-
if(!fs.existsSync(trustedDomainsDestinationPath)){
|
|
22
|
-
fs.copyFileSync(path.join(__dirname, "..", "dist", trustedDomainsFilename), trustedDomainsDestinationPath);
|
|
23
|
-
console.log(`File copied successfully at ${trustedDomainsDestinationPath}`);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
} catch (ex) {
|
|
27
|
-
console.error(ex);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
try {
|
|
32
|
-
const args = process.argv;
|
|
33
|
-
if (args.length >= 3) {
|
|
34
|
-
const input = args[2];
|
|
35
|
-
applyCopy(input);
|
|
36
|
-
} else if(__dirname.includes("@axa-fr")) {
|
|
37
|
-
applyCopy("../../../../public");
|
|
38
|
-
} else {
|
|
39
|
-
applyCopy("../public");
|
|
40
|
-
}
|
|
41
|
-
} catch (ex) {
|
|
42
|
-
console.error(ex);
|
|
43
|
-
}
|