@axa-fr/react-oidc 6.25.5 → 6.26.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/FetchToken.d.ts +1 -1
- package/dist/FetchToken.d.ts.map +1 -1
- package/dist/OidcProvider.d.ts +1 -1
- package/dist/OidcProvider.d.ts.map +1 -1
- package/dist/OidcSecure.d.ts +1 -1
- package/dist/OidcSecure.d.ts.map +1 -1
- package/dist/ReactOidc.d.ts +1 -1
- package/dist/ReactOidc.d.ts.map +1 -1
- package/dist/User.d.ts +1 -1
- package/dist/User.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.umd.cjs +8 -8
- package/package.json +4 -14
- package/src/FetchToken.tsx +1 -1
- package/src/OidcProvider.tsx +1 -1
- package/src/OidcSecure.tsx +1 -1
- package/src/ReactOidc.tsx +1 -1
- package/src/User.ts +1 -1
- package/src/core/default-component/Callback.component.tsx +1 -1
- package/src/core/default-component/SilentCallback.component.tsx +1 -1
- package/src/core/default-component/SilentLogin.component.tsx +1 -1
- package/src/core/routes/OidcRoutes.spec.tsx +4 -3
- package/src/core/routes/OidcRoutes.tsx +1 -1
- package/src/core/routes/withRouter.spec.tsx +4 -3
- package/src/index.ts +2 -2
package/dist/FetchToken.d.ts
CHANGED
package/dist/FetchToken.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FetchToken.d.ts","sourceRoot":"","sources":["../src/src/FetchToken.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAe,MAAM,
|
|
1
|
+
{"version":3,"file":"FetchToken.d.ts","sourceRoot":"","sources":["../src/src/FetchToken.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAe,MAAM,qBAAqB,CAAC;AAGzD,MAAM,WAAW,2BAA2B;IAC1C,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAiCD,eAAO,MAAM,aAAa,WAAW,KAAK,oEAE7B,2BAA2B,4CAGvC,CAAC;AAEF,eAAO,MAAM,YAAY,WAAW,KAAK;mBAK7B,WAAW,GAAG,GAAG,SAAS,WAAW;CAQhD,CAAC"}
|
package/dist/OidcProvider.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Fetch, OidcConfiguration, VanillaOidc } from '@axa-fr/
|
|
1
|
+
import { Fetch, OidcConfiguration, VanillaOidc } from '@axa-fr/oidc-client';
|
|
2
2
|
import { ComponentType, FC, PropsWithChildren } from 'react';
|
|
3
3
|
import { CustomHistory } from './core/routes/withRouter.js';
|
|
4
4
|
export type oidcContext = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OidcProvider.d.ts","sourceRoot":"","sources":["../src/src/OidcProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAmB,iBAAiB,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"OidcProvider.d.ts","sourceRoot":"","sources":["../src/src/OidcProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAmB,iBAAiB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAE,EAAE,EAAE,iBAAiB,EAAuB,MAAM,OAAO,CAAC;AAMlF,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,MAAM,MAAM,WAAW,GAAG;IACtB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;CAChC,CAAC;AAIF,MAAM,MAAM,iBAAiB,GAAG;IAC5B,wBAAwB,CAAC,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;IAC9C,oBAAoB,CAAC,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;IAC1C,uBAAuB,CAAC,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;IAC7C,4BAA4B,CAAC,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;IAClD,gBAAgB,CAAC,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;IACtC,kCAAkC,CAAC,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;IACxD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC,QAAQ,EAAE,GAAG,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,sBAAsB,CAAC,EAAE,MAAM,IAAI,CAAC;IACpC,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC,iBAAiB,CAAC,EAAE,MAAM,aAAa,CAAC;IACxC,OAAO,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IACnE,QAAQ,CAAC,EAAE,MAAM,KAAK,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,iBAAiB,CAAC,GAAG,CAAC,CAAC;CAC5C,CAAC;AA0CF,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CA8HjE,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
package/dist/OidcSecure.d.ts
CHANGED
package/dist/OidcSecure.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OidcSecure.d.ts","sourceRoot":"","sources":["../src/src/OidcSecure.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAe,MAAM,
|
|
1
|
+
{"version":3,"file":"OidcSecure.d.ts","sourceRoot":"","sources":["../src/src/OidcSecure.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAe,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,EAAE,EAAE,iBAAiB,EAAa,MAAM,OAAO,CAAC;AAEzD,MAAM,MAAM,eAAe,GAAG;IAC1B,YAAY,CAAC,EAAC,MAAM,CAAC;IACrB,MAAM,CAAC,EAAC,SAAS,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAa7D,CAAC;AAEF,eAAO,MAAM,cAAc,qBACP,GAAG,kBAAkB,eAAe,CAAC,CAAC,0HAMzD,CAAC"}
|
package/dist/ReactOidc.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StringMap } from '@axa-fr/
|
|
1
|
+
import { StringMap } from '@axa-fr/oidc-client';
|
|
2
2
|
export declare const useOidc: (configurationName?: string) => {
|
|
3
3
|
login: (callbackPath?: string | undefined, extras?: StringMap, silentLoginOnly?: boolean) => Promise<unknown>;
|
|
4
4
|
logout: (callbackPath?: string | null | undefined, extras?: StringMap) => Promise<void>;
|
package/dist/ReactOidc.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactOidc.d.ts","sourceRoot":"","sources":["../src/src/ReactOidc.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAe,MAAM,
|
|
1
|
+
{"version":3,"file":"ReactOidc.d.ts","sourceRoot":"","sources":["../src/src/ReactOidc.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAe,MAAM,qBAAqB,CAAC;AAkB7D,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;AAiBF,MAAM,MAAM,eAAe,GAAG;IAC1B,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,kBAAkB,CAAC,EAAE,GAAG,CAAC;CAC5B,CAAA;AAED,eAAO,MAAM,kBAAkB,iDAgC9B,CAAC;AAcF,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/User.d.ts
CHANGED
package/dist/User.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"User.d.ts","sourceRoot":"","sources":["../src/src/User.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAe,MAAM,
|
|
1
|
+
{"version":3,"file":"User.d.ts","sourceRoot":"","sources":["../src/src/User.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAe,MAAM,qBAAqB,CAAC;AAGrE,oBAAY,cAAc;IACtB,eAAe,oBAAmB;IAClC,OAAO,iBAAiB;IACxB,MAAM,gBAAgB;IACtB,YAAY,uBAAuB;CACtC;AAED,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,IAAI;IAC1D,IAAI,EAAE,CAAC,CAAC;IACR,MAAM,EAAE,cAAc,CAAC;CAC1B,CAAA;AAED,eAAO,MAAM,WAAW;;;;CA6BvB,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, } from '@axa-fr/
|
|
7
|
-
export { type OidcUserInfo, TokenRenewMode } from '@axa-fr/
|
|
6
|
+
export type { AuthorityConfiguration, Fetch, OidcConfiguration, StringMap, } from '@axa-fr/oidc-client';
|
|
7
|
+
export { type OidcUserInfo, TokenRenewMode } 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/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,GACV,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/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,GACV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import be, { useCallback as kt, useState as P, useEffect as O } from "react";
|
|
2
|
-
import { VanillaOidc as f, getParseQueryStringFromLocation as mt, getPath as z, getFetchDefault as Et } from "@axa-fr/
|
|
3
|
-
import { TokenRenewMode as rr } from "@axa-fr/
|
|
2
|
+
import { VanillaOidc as f, getParseQueryStringFromLocation as mt, getPath as z, getFetchDefault as Et } from "@axa-fr/oidc-client";
|
|
3
|
+
import { TokenRenewMode as rr } from "@axa-fr/oidc-client";
|
|
4
4
|
var ye = { exports: {} }, G = {};
|
|
5
5
|
/**
|
|
6
6
|
* @license React
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(R,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("react"),require("@axa-fr/oidc-client")):typeof define=="function"&&define.amd?define(["exports","react","@axa-fr/oidc-client"],y):(R=typeof globalThis<"u"?globalThis:R||self,y(R["react-oidc"]={},R.React,R.oidcClient))})(this,function(R,y,l){"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 be;function Qe(){if(be)return G;be=1;var
|
|
9
|
+
*/var be;function Qe(){if(be)return G;be=1;var a=y,s=Symbol.for("react.element"),n=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,d=a.__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,O={},S=null,I=null;g!==void 0&&(S=""+g),v.key!==void 0&&(S=""+v.key),v.ref!==void 0&&(I=v.ref);for(k in v)o.call(v,k)&&!u.hasOwnProperty(k)&&(O[k]=v[k]);if(i&&i.defaultProps)for(k in v=i.defaultProps,v)O[k]===void 0&&(O[k]=v[k]);return{$$typeof:s,type:i,key:S,ref:I,props:O,_owner:d.current}}return G.Fragment=n,G.jsx=h,G.jsxs=h,G}var H={};/**
|
|
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 ke;function Ze(){return ke||(ke=1,process.env.NODE_ENV!=="production"&&function(){var
|
|
18
|
-
`+fe+e}}var ve=!1,q;{var
|
|
19
|
-
`),
|
|
20
|
-
`),
|
|
21
|
-
`+p[
|
|
17
|
+
*/var ke;function Ze(){return ke||(ke=1,process.env.NODE_ENV!=="production"&&function(){var a=y,s=Symbol.for("react.element"),n=Symbol.for("react.portal"),o=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"),O=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen"),X=Symbol.iterator,U="@@iterator";function se(e){if(e===null||typeof e!="object")return null;var t=X&&e[X]||e[U];return typeof t=="function"?t:null}var D=a.__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 oe=!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===o||e===u||L||e===d||e===g||e===k||le||e===I||oe||ce||ie||typeof e=="object"&&e!==null&&(e.$$typeof===S||e.$$typeof===O||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 V(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 o: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 O:var f=e.displayName||null;return f!==null?f:V(e.type)||"Memo";case S:{var b=e,m=b._payload,_=b._init;try{return V(_(m))}catch{return null}}}return null}var A=Object.assign,C=0,T,F,Pe,Ae,Ve,Ce,Fe;function Ne(){}Ne.__reactDisabledLog=!0;function Ot(){{if(C===0){T=console.log,F=console.info,Pe=console.warn,Ae=console.error,Ve=console.group,Ce=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})}C++}}function Et(){{if(C--,C===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:A({},e,{value:T}),info:A({},e,{value:F}),warn:A({},e,{value:Pe}),error:A({},e,{value:Ae}),group:A({},e,{value:Ve}),groupCollapsed:A({},e,{value:Ce}),groupEnd:A({},e,{value:Fe})})}C<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 Tt=typeof WeakMap=="function"?WeakMap:Map;q=new Tt}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,Ot();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
|
+
`),x=f.stack.split(`
|
|
20
|
+
`),E=p.length-1,w=x.length-1;E>=1&&w>=0&&p[E]!==x[w];)w--;for(;E>=1&&w>=0;E--,w--)if(p[E]!==x[w]){if(E!==1||w!==1)do if(E--,w--,w<0||p[E]!==x[w]){var P=`
|
|
21
|
+
`+p[E].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),typeof e=="function"&&q.set(e,P),P}while(E>=1&&w>=0);break}}}finally{ve=!1,de.current=m,Et(),Error.prepareStackTrace=b}var z=e?e.displayName||e.name:"",Xe=z?Z(z):"";return typeof e=="function"&&q.set(e,Xe),Xe}function wt(e,t,r){return Ie(e,!1)}function Rt(e){var t=e.prototype;return!!(t&&t.isReactComponent)}function $(e,t,r){if(e==null)return"";if(typeof e=="function")return Ie(e,Rt(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 wt(e.render);case O:return $(e.type,t,r);case S:{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 St(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 x=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 x.name="Invariant Violation",x}p=e[_](t,_,f,r,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(E){p=E}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 xt(e){{var t=typeof Symbol=="function"&&Symbol.toStringTag,r=t&&e[Symbol.toStringTag]||e.constructor.name||"Object";return r}}function Pt(e){try{return Ue(e),!1}catch{return!0}}function Ue(e){return""+e}function We(e){if(Pt(e))return j("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",xt(e)),Ue(e)}var K=D.ReactCurrentOwner,At={key:!0,ref:!0,__self:!0,__source:!0},Me,Ye,pe;pe={};function Vt(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 Ct(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=V(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',V(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:s,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,x=null;r!==void 0&&(We(r),p=""+r),Ct(t)&&(We(t.key),p=""+t.key),Vt(t)&&(x=t.ref,Ft(t,b));for(m in t)ee.call(t,m)&&!At.hasOwnProperty(m)&&(_[m]=t[m]);if(e&&e.defaultProps){var E=e.defaultProps;for(m in E)_[m]===void 0&&(_[m]=E[m])}if(p||x){var w=typeof e=="function"?e.displayName||e.name||"Unknown":e;p&&Nt(_,w),x&&It(_,w)}return Dt(e,p,x,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===s}function ze(){{if(_e.current){var e=V(_e.current.type);if(e)return`
|
|
22
22
|
|
|
23
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
24
|
|
|
25
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
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"})});
|
|
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 "+V(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=se(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===O))r=t.propTypes;else return;if(r){var f=V(t);St(r,e.props,"prop",f,e)}else if(t.PropTypes!==void 0&&!ge){ge=!0;var b=V(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 x=Ut(b);x?p+=x:p+=ze();var E;e===null?E="null":he(e)?E="array":e!==void 0&&e.$$typeof===s?(E="<"+(V(e.type)||"Unknown")+" />",p=" Did you accidentally export a JSX literal instead of a component?"):E=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",E,p)}var w=Lt(e,t,r,b,m);if(w==null)return w;if(_){var P=t.children;if(P!==void 0)if(f)if(he(P)){for(var z=0;z<P.length;z++)Je(P[z],e);Object.freeze&&Object.freeze(P)}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(P,e)}return e===o?Yt(w):Mt(w),w}}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=o,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=(a,s)=>async(...n)=>{var S;const[o,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 s().getValidTokenAsync(),k=(S=g==null?void 0:g.tokens)==null?void 0:S.accessToken;i.has("Accept")||i.set("Accept","application/json"),k&&(i.set("Authorization",`Bearer ${k}`),h.credentials||(h.credentials="same-origin"));const O={...h,headers:i};return await a(o,O,...u)},$e=(a=null,s=me)=>n=>o=>{const{fetch:d}=Oe(a||o.fetch,s);return c.jsx(n,{...o,fetch:d})},Oe=(a=null,s=me)=>{const n=a||window.fetch,o=l.VanillaOidc.get;return{fetch:y.useCallback((u,h)=>qe(n,()=>o(s))(u,h),[n,s])}},Ee=()=>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=(a,s)=>(n,o)=>{if(typeof a.CustomEvent=="function")return new a.CustomEvent(n,o);const d=o||{bubbles:!1,cancelable:!1,detail:void 0},u=s.createEvent("CustomEvent");return u.initCustomEvent(n,d.bubbles,d.cancelable,d.detail),u.prototype=a.Event.prototype,u},rt=(a,s,n)=>({replaceState:(o,d)=>{const u=n(),h=d||a.history.state;a.history.replaceState({key:u,state:h},null,o),a.dispatchEvent(s("popstate"))}}),at=()=>rt(window,nt(window,document),tt),Te=()=>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."})]})}),st=({callBackError:a,callBackSuccess:s,configurationName:n,withCustomHistory:o})=>{const[d,u]=y.useState(!1);y.useEffect(()=>{let v=!0;return(async()=>{const k=l.VanillaOidc.get;try{const{callbackPath:O}=await k(n).loginCallbackAsync();(o?o():at()).replaceState(O||"/")}catch(O){v&&(console.warn(O),u(!0))}})(),()=>{v=!1}},[]);const h=a||Ee,i=s||Te;return d?c.jsx(h,{configurationName:n}):c.jsx(i,{configurationName:n})},ot=()=>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:a})=>(y.useEffect(()=>{(async()=>{const n=l.VanillaOidc.get;n(a).silentLoginCallbackAsync()})()},[]),c.jsx(c.Fragment,{})),ut=({configurationName:a})=>{const s=l.getParseQueryStringFromLocation(window.location.href),n=l.VanillaOidc.get,o=n(a);let d=null;for(const[u,h]of Object.entries(s))u==="state"||u==="scope"||(d===null&&(d={}),d[u]=h);return y.useEffect(()=>{o.tokens||o.loginAsync(null,d,!0,s.scope)},[]),c.jsx(c.Fragment,{})},dt=({callbackErrorComponent:a,callbackSuccessComponent:s,redirect_uri:n,silent_redirect_uri:o,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 S=()=>k(l.getPath(window.location.href));return S(),window.addEventListener("popstate",S,!1),()=>window.removeEventListener("popstate",S,!1)},[]);const O=l.getPath(n);if(o&&g===l.getPath(o))return c.jsx(lt,{configurationName:h});if(d&&g===l.getPath(d))return c.jsx(ut,{configurationName:h});switch(g){case O:return c.jsx(st,{callBackError:a,callBackSuccess:s,configurationName:h,withCustomHistory:i});default:return c.jsx(c.Fragment,{children:u})}},ft=y.memo(dt),we={name:"",data:null},vt=({loadingComponent:a,children:s,configurationName:n})=>{const[o,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=a;return c.jsx(c.Fragment,{children:o?c.jsx(i,{configurationName:n}):c.jsx(c.Fragment,{children:s})})},J=({isLoading:a,loadingComponent:s,children:n,configurationName:o})=>{const d=s;return a?c.jsx(d,{configurationName:o,children:n}):c.jsx(c.Fragment,{children:n})},ht=({children:a,configuration:s,configurationName:n="default",callbackSuccessComponent:o=Te,authenticatingComponent:d=et,loadingComponent:u=ot,serviceWorkerNotSupportedComponent:h=ct,authenticatingErrorComponent:i=Ee,sessionLostComponent:v=it,onSessionLost:g=null,onLogoutFromAnotherTab:k=null,onLogoutFromSameTab:O=null,withCustomHistory:S=null,onEvent:I=null,getFetch:X=null})=>{const U=(A="default")=>l.VanillaOidc.getOrCreate(X??l.getFetchDefault)(s,A),[se,D]=y.useState(!0),[j,W]=y.useState(we),[oe,ce]=y.useState("default");y.useEffect(()=>{const C=U(n).subscribeEvents((T,F)=>{I&&I(n,T,F)});return()=>{U(n).removeEventSubscription(C)}},[n,I]),y.useEffect(()=>{const C=U(n).subscribeEvents((T,F)=>{if(T===l.VanillaOidc.eventNames.refreshTokensAsync_error||T===l.VanillaOidc.eventNames.syncTokensAsync_error){if(g!=null){g();return}W({name:T,data:F})}else if(T===l.VanillaOidc.eventNames.logout_from_another_tab){if(k!=null){k();return}W({name:T,data:F})}else T===l.VanillaOidc.eventNames.logout_from_same_tab?O!=null&&O():T===l.VanillaOidc.eventNames.loginAsync_begin||T===l.VanillaOidc.eventNames.loginCallbackAsync_end||T===l.VanillaOidc.eventNames.loginAsync_error||T===l.VanillaOidc.eventNames.loginCallbackAsync_error?W({name:T,data:F}):T===l.VanillaOidc.eventNames.service_worker_not_supported_by_browser&&s.service_worker_only===!0&&W({name:T,data:F})});return ce(n),D(!1),()=>{U(n).removeEventSubscription(C),W(we)}},[s,n]);const ie=v,le=d,L=u,Q=h,ue=i,M=se||oe!==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:o,callbackErrorComponent:i,authenticatingComponent:d,configurationName:n,withCustomHistory:S,children:c.jsx(vt,{loadingComponent:L,configurationName:n,children:a})})})}},Re=({children:a,callbackPath:s=null,extras:n=null,configurationName:o="default"})=>{const d=l.VanillaOidc.get,u=d(o);return y.useEffect(()=>{u.tokens||u.loginAsync(s,n)},[o,s,n]),u.tokens?c.jsx(c.Fragment,{children:a}):null},pt=(a,s=null,n=null,o="default")=>d=>c.jsx(Re,{callbackPath:s,extras:n,configurationName:o,children:c.jsx(a,{...d})}),re="default",ae=(a,s)=>{let n=!1;return a(s)&&(n=a(s).tokens!=null),n},_t=(a=re)=>{const s=l.VanillaOidc.get,[n,o]=y.useState(ae(s,a));return y.useEffect(()=>{let i=!0;const v=s(a);o(ae(s,a));const g=v.subscribeEvents((k,O)=>{(k===l.VanillaOidc.eventNames.logout_from_another_tab||k===l.VanillaOidc.eventNames.logout_from_same_tab||k===l.VanillaOidc.eventNames.token_aquired)&&i&&o(ae(s,a))});return()=>{i=!1,v.removeEventSubscription(g)}},[a]),{login:(i=void 0,v=null,g=!1)=>s(a).loginAsync(i,v,!1,void 0,g),logout:(i=void 0,v=null)=>s(a).logoutAsync(i,v),renewTokens:async(i=null)=>{const v=await s(a).renewTokensAsync(i);return{accessToken:v.accessToken,accessTokenPayload:v.accessTokenPayload,idToken:v.idToken,idTokenPayload:v.idTokenPayload}},isAuthenticated:n}},Se={accessToken:null,accessTokenPayload:null},gt=a=>{const s=l.VanillaOidc.get,n=s(a);if(n.tokens){const o=n.tokens;return{accessToken:o.accessToken,accessTokenPayload:o.accessTokenPayload}}return Se},yt=(a=re)=>{const s=l.VanillaOidc.get,[n,o]=y.useState(gt(a));return y.useEffect(()=>{let d=!0;const u=s(a);if(u.tokens){const i=u.tokens;o({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;o(g!=null?{accessToken:g.accessToken,accessTokenPayload:g.accessTokenPayload}:Se)}});return()=>{d=!1,u.removeEventSubscription(h)}},[a]),n},je={idToken:null,idTokenPayload:null},bt=a=>{const s=l.VanillaOidc.get,n=s(a);if(n.tokens){const o=n.tokens;return{idToken:o.idToken,idTokenPayload:o.idTokenPayload}}return je},kt=(a=re)=>{const s=l.VanillaOidc.get,[n,o]=y.useState(bt(a));return y.useEffect(()=>{let d=!0;const u=s(a);if(u.tokens){const i=u.tokens;o({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;o(g!=null?{idToken:g.idToken,idTokenPayload:g.idTokenPayload}:je)}});return()=>{d=!1,u.removeEventSubscription(h)}},[a]),n};var xe=(a=>(a.Unauthenticated="Unauthenticated",a.Loading="Loading user",a.Loaded="User loaded",a.LoadingError="Error loading user",a))(xe||{});const mt=(a="default")=>{const[s,n]=y.useState({user:null,status:"Unauthenticated"}),[o,d]=y.useState(""),u=l.VanillaOidc.get(a);y.useEffect(()=>{let i=!0;if(u&&u.tokens){n({...s,status:"Loading user"});const v=o!=="";u.userInfoAsync(v).then(g=>{i&&n({user:g,status:"User loaded"})}).catch(()=>n({...s,status:"Error loading user"}))}else n({user:null,status:"Unauthenticated"});return()=>{i=!1}},[o]);const h=()=>{d(o+" ")};return{oidcUser:s.user,oidcUserLoadingState:s.status,reloadOidcUser:h}};Object.defineProperty(R,"TokenRenewMode",{enumerable:!0,get:()=>l.TokenRenewMode}),R.OidcProvider=ht,R.OidcSecure=Re,R.OidcUserStatus=xe,R.useOidc=_t,R.useOidcAccessToken=yt,R.useOidcFetch=Oe,R.useOidcIdToken=kt,R.useOidcUser=mt,R.withOidcFetch=$e,R.withOidcSecure=pt,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axa-fr/react-oidc",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.26.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.umd.cjs",
|
|
@@ -40,33 +40,23 @@
|
|
|
40
40
|
"lint": "eslint src"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@axa-fr/oidc-client-service-worker": "6.
|
|
44
|
-
"@axa-fr/
|
|
43
|
+
"@axa-fr/oidc-client-service-worker": "6.26.6",
|
|
44
|
+
"@axa-fr/oidc-client": "6.26.6",
|
|
45
45
|
"base64-js": "1.5.1"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"react": "^17.0.0 || ^18.0.0"
|
|
49
|
-
"react-dom": "^17.0.0 || ^18.0.0",
|
|
50
|
-
"react-router-dom": "^6.0.0"
|
|
48
|
+
"react": "^17.0.0 || ^18.0.0"
|
|
51
49
|
},
|
|
52
50
|
"devDependencies": {
|
|
53
51
|
"@testing-library/jest-dom": "5.16.5",
|
|
54
52
|
"@testing-library/react": "13.3.0",
|
|
55
53
|
"@testing-library/user-event": "14.4.3",
|
|
56
54
|
"@types/react": "^18.2.15",
|
|
57
|
-
"@typescript-eslint/eslint-plugin": "^5.50.0",
|
|
58
|
-
"@typescript-eslint/parser": "^5.50.0",
|
|
59
55
|
"@vitejs/plugin-react": "4.0.3",
|
|
60
56
|
"@vitest/coverage-v8": "^0.33.0",
|
|
61
57
|
"cpy": "^10.1.0",
|
|
62
58
|
"cpy-cli": "^5.0.0",
|
|
63
59
|
"cross-env": "^7.0.3",
|
|
64
|
-
"eslint": "^8.26.0",
|
|
65
|
-
"eslint-config-standard": "^17.1.0",
|
|
66
|
-
"eslint-config-standard-with-typescript": "^36.1.0",
|
|
67
|
-
"eslint-import-resolver-typescript": "^3.5.5",
|
|
68
|
-
"eslint-plugin-react": "^7.32.2",
|
|
69
|
-
"eslint-plugin-simple-import-sort": "^10.0.0",
|
|
70
60
|
"jsdom": "22.1.0",
|
|
71
61
|
"msw": "1.2.2",
|
|
72
62
|
"react": "^18.2.0",
|
package/src/FetchToken.tsx
CHANGED
package/src/OidcProvider.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Fetch, getFetchDefault, OidcConfiguration, VanillaOidc } from '@axa-fr/
|
|
1
|
+
import { Fetch, getFetchDefault, OidcConfiguration, VanillaOidc } from '@axa-fr/oidc-client';
|
|
2
2
|
import { ComponentType, FC, PropsWithChildren, useEffect, useState } from 'react';
|
|
3
3
|
|
|
4
4
|
import AuthenticatingError from './core/default-component/AuthenticateError.component.js';
|
package/src/OidcSecure.tsx
CHANGED
package/src/ReactOidc.tsx
CHANGED
package/src/User.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getParseQueryStringFromLocation, VanillaOidc } from '@axa-fr/
|
|
1
|
+
import { getParseQueryStringFromLocation, VanillaOidc } from '@axa-fr/oidc-client';
|
|
2
2
|
import { ComponentType, useEffect } from 'react';
|
|
3
3
|
|
|
4
4
|
const SilentLogin: ComponentType<any> = ({ configurationName }) => {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { render } from "@testing-library/react";
|
|
1
2
|
import React from 'react';
|
|
3
|
+
import { describe, expect,it } from 'vitest';
|
|
4
|
+
|
|
2
5
|
import OidcRoutes from './OidcRoutes';
|
|
3
|
-
import { render } from "@testing-library/react";
|
|
4
|
-
import { describe, it, expect } from 'vitest';
|
|
5
6
|
|
|
6
7
|
describe('Authenticating test suite', () => {
|
|
7
8
|
it('renders correctly', () => {
|
|
@@ -9,7 +10,7 @@ describe('Authenticating test suite', () => {
|
|
|
9
10
|
children: 'http://url.com',
|
|
10
11
|
callbackComponent: () => <div>tcallback component</div>,
|
|
11
12
|
redirect_uri: 'http://example.com:3000/authentication/callback',
|
|
12
|
-
configurationName: ''
|
|
13
|
+
configurationName: '',
|
|
13
14
|
};
|
|
14
15
|
const { asFragment } = render(<OidcRoutes {...props} />);
|
|
15
16
|
expect(asFragment()).toMatchSnapshot();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { beforeEach,describe, expect, it, vi } from 'vitest';
|
|
2
|
+
|
|
1
3
|
import { CreateEvent, WindowInternal } from './withRouter';
|
|
2
|
-
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
3
4
|
|
|
4
5
|
describe('WithRouter test Suite', () => {
|
|
5
6
|
const paramsMock = { bubbles: false, cancelable: false, detail: 'detail' };
|
|
@@ -13,7 +14,7 @@ describe('WithRouter test Suite', () => {
|
|
|
13
14
|
const documentMock = {} as Document;
|
|
14
15
|
const res = CreateEvent((windowMock as unknown) as WindowInternal, documentMock)(
|
|
15
16
|
'event test',
|
|
16
|
-
paramsMock
|
|
17
|
+
paramsMock,
|
|
17
18
|
);
|
|
18
19
|
expect(res).toEqual({
|
|
19
20
|
event: 'event test',
|
|
@@ -36,7 +37,7 @@ describe('WithRouter test Suite', () => {
|
|
|
36
37
|
const typedDocumentMock = (documentMock as unknown) as Document;
|
|
37
38
|
const res = CreateEvent((windowMock as unknown) as WindowInternal, typedDocumentMock)(
|
|
38
39
|
'event test',
|
|
39
|
-
paramsMock
|
|
40
|
+
paramsMock,
|
|
40
41
|
);
|
|
41
42
|
expect(res).toEqual({ ...evtMock });
|
|
42
43
|
expect(documentMock.createEvent).toHaveBeenCalledWith('CustomEvent');
|
package/src/index.ts
CHANGED
|
@@ -8,5 +8,5 @@ export type {
|
|
|
8
8
|
Fetch,
|
|
9
9
|
OidcConfiguration,
|
|
10
10
|
StringMap,
|
|
11
|
-
} from '@axa-fr/
|
|
12
|
-
export { type OidcUserInfo, TokenRenewMode } from '@axa-fr/
|
|
11
|
+
} from '@axa-fr/oidc-client';
|
|
12
|
+
export { type OidcUserInfo, TokenRenewMode } from '@axa-fr/oidc-client';
|