From c4182b3f3a282a45edab2a6d6b1a669721782096 Mon Sep 17 00:00:00 2001 From: nirgur Date: Sun, 22 Dec 2024 12:20:51 +0200 Subject: [PATCH] fix: multiple flows on the same page (#868) --- .../components/descope/descope.component.ts | 14 +- .../sdks/react-sdk/src/components/Descope.tsx | 7 +- packages/sdks/vue-sdk/src/Descope.vue | 4 +- .../src/lib/descope-wc/BaseDescopeWc.ts | 4 +- .../web-component/src/lib/helpers/helpers.ts | 35 ++- .../src/lib/mixins/formMountMixin.ts | 2 +- .../web-component/test/helpers/index.test.ts | 35 ++- .../widgets/user-profile-widget/package.json | 2 +- .../user-profile-widget/rollup.config.mjs | 24 +- .../src/lib/widget/index.ts | 8 +- .../widgets/user-profile-widget/tsconfig.json | 3 +- pnpm-lock.yaml | 209 ++++++++++++------ 12 files changed, 254 insertions(+), 93 deletions(-) diff --git a/packages/sdks/angular-sdk/projects/angular-sdk/src/lib/components/descope/descope.component.ts b/packages/sdks/angular-sdk/projects/angular-sdk/src/lib/components/descope/descope.component.ts index f3f1604b5..2423bef55 100644 --- a/packages/sdks/angular-sdk/projects/angular-sdk/src/lib/components/descope/descope.component.ts +++ b/packages/sdks/angular-sdk/projects/angular-sdk/src/lib/components/descope/descope.component.ts @@ -63,7 +63,9 @@ export class DescopeComponent implements OnInit, OnChanges { ngOnInit() { const sdk = this.authService.descopeSdk; // Capture the class context in a variable - DescopeWc.sdkConfigOverrides = { + const WebComponent: any = customElements?.get('descope-wc') || DescopeWc; + + WebComponent.sdkConfigOverrides = { // Overrides the web-component's base headers to indicate usage via the React SDK baseHeaders, // Disables token persistence within the web-component to delegate token management @@ -126,10 +128,16 @@ export class DescopeComponent implements OnInit, OnChanges { this.webComponent.setAttribute('auto-focus', this.autoFocus.toString()); } if (this.validateOnBlur) { - this.webComponent.setAttribute('validate-on-blur', this.autoFocus.toString()); + this.webComponent.setAttribute( + 'validate-on-blur', + this.autoFocus.toString() + ); } if (this.restartOnError) { - this.webComponent.setAttribute('restart-on-error', this.autoFocus.toString()); + this.webComponent.setAttribute( + 'restart-on-error', + this.autoFocus.toString() + ); } if (this.debug) { this.webComponent.setAttribute('debug', this.debug.toString()); diff --git a/packages/sdks/react-sdk/src/components/Descope.tsx b/packages/sdks/react-sdk/src/components/Descope.tsx index 62618de7e..4f93c6189 100644 --- a/packages/sdks/react-sdk/src/components/Descope.tsx +++ b/packages/sdks/react-sdk/src/components/Descope.tsx @@ -14,8 +14,11 @@ import { getGlobalSdk } from '../sdk'; // web-component code uses browser API, but can be used in SSR apps, hence the lazy loading const DescopeWC = lazy(async () => { - const module = await import('@descope/web-component'); - module.default.sdkConfigOverrides = { + const WebComponent: any = + customElements?.get('descope-wc') || + (await import('@descope/web-component').then((module) => module.default)); + + WebComponent.sdkConfigOverrides = { // Overrides the web-component's base headers to indicate usage via the React SDK baseHeaders, // Disables token persistence within the web-component to delegate token management diff --git a/packages/sdks/vue-sdk/src/Descope.vue b/packages/sdks/vue-sdk/src/Descope.vue index f23097881..12a39d525 100644 --- a/packages/sdks/vue-sdk/src/Descope.vue +++ b/packages/sdks/vue-sdk/src/Descope.vue @@ -36,7 +36,9 @@ import { computed } from 'vue'; import { getGlobalSdk } from './sdk'; import type { JWTResponse, ErrorResponse } from './types'; -DescopeWcClass.sdkConfigOverrides = { +const WebComponent: any = customElements?.get('descope-wc') || DescopeWcClass; + +WebComponent.sdkConfigOverrides = { // Overrides the web-component's base headers to indicate usage via the React SDK baseHeaders, // Disables token persistence within the web-component to delegate token management diff --git a/packages/sdks/web-component/src/lib/descope-wc/BaseDescopeWc.ts b/packages/sdks/web-component/src/lib/descope-wc/BaseDescopeWc.ts index 91759a502..4499338d4 100644 --- a/packages/sdks/web-component/src/lib/descope-wc/BaseDescopeWc.ts +++ b/packages/sdks/web-component/src/lib/descope-wc/BaseDescopeWc.ts @@ -229,7 +229,7 @@ class BaseDescopeWc extends BaseClass { } #syncStateIdFromUrl() { - const { stepId, executionId } = getRunIdsFromUrl(); + const { stepId, executionId } = getRunIdsFromUrl(this.flowId); this.#flowState.update({ stepId, executionId }); } @@ -517,7 +517,7 @@ class BaseDescopeWc extends BaseClass { redirectAuthCodeChallenge, redirectAuthInitiator, ssoQueryParams, - } = handleUrlParams(); + } = handleUrlParams(this.flowId, this.loggerWrapper); // we want to update the state when user clicks on back in the browser window.addEventListener('popstate', this.#eventsCbRefs.popstate); diff --git a/packages/sdks/web-component/src/lib/helpers/helpers.ts b/packages/sdks/web-component/src/lib/helpers/helpers.ts index 0a2cb1016..4227f61cf 100644 --- a/packages/sdks/web-component/src/lib/helpers/helpers.ts +++ b/packages/sdks/web-component/src/lib/helpers/helpers.ts @@ -57,6 +57,11 @@ function resetUrlParam(paramName: string) { } } +const getFlowIdFromExecId = (executionId: string) => { + const regex = /(.*)\|#\|.*/; + return regex.exec(executionId)?.[1] || ''; +}; + export async function fetchContent( url: string, returnType: T, @@ -109,10 +114,17 @@ export function getAnimationDirection( return undefined; } -export const getRunIdsFromUrl = () => { - const [executionId = '', stepId = ''] = (getFlowUrlParam() || '').split('_'); +export const getRunIdsFromUrl = (flowId: string) => { + let [executionId = '', stepId = ''] = (getFlowUrlParam() || '').split('_'); + const executionFlowId = getFlowIdFromExecId(executionId); + + // if the flow id does not match, this execution id is not for this flow + if (!flowId || (executionFlowId && executionFlowId !== flowId)) { + executionId = ''; + stepId = ''; + } - return { executionId, stepId }; + return { executionId, stepId, executionFlowId }; }; export const setRunIdsOnUrl = (executionId: string, stepId: string) => { @@ -284,8 +296,21 @@ export const getElementDescopeAttributes = (ele: HTMLElement) => export const getFlowConfig = (config: Record, flowId: string) => config?.flows?.[flowId] || {}; -export const handleUrlParams = () => { - const { executionId, stepId } = getRunIdsFromUrl(); +export const handleUrlParams = ( + flowId: string, + logger: { debug: (...data: any[]) => void }, +) => { + const { executionId, stepId, executionFlowId } = getRunIdsFromUrl(flowId); + + // if the flow id does not match, we do not want to read & remove any query params + // because it's probably belongs to another flow + if (executionFlowId && flowId !== executionFlowId) { + logger.debug( + 'Flow id does not match the execution flow id, skipping url params handling', + ); + return { ssoQueryParams: {} }; + } + if (executionId || stepId) { clearRunIdsFromUrl(); } diff --git a/packages/sdks/web-component/src/lib/mixins/formMountMixin.ts b/packages/sdks/web-component/src/lib/mixins/formMountMixin.ts index 4321ebde7..13bf433d1 100644 --- a/packages/sdks/web-component/src/lib/mixins/formMountMixin.ts +++ b/packages/sdks/web-component/src/lib/mixins/formMountMixin.ts @@ -26,7 +26,7 @@ export const formMountMixin = createSingletonMixin( if (this.#shouldMountInFormEle()) { this.#handleOuterForm(); } - super['connectedCallback']?.(); + super.connectedCallback?.(); } }, ); diff --git a/packages/sdks/web-component/test/helpers/index.test.ts b/packages/sdks/web-component/test/helpers/index.test.ts index 558888749..55d05d2b7 100644 --- a/packages/sdks/web-component/test/helpers/index.test.ts +++ b/packages/sdks/web-component/test/helpers/index.test.ts @@ -59,9 +59,40 @@ describe('helpers', () => { writable: true, value: new URL('http://localhost'), }); - window.location.search = `?${URL_RUN_IDS_PARAM_NAME}=8_9`; - expect(getRunIdsFromUrl()).toEqual({ executionId: '8', stepId: '9' }); + window.location.search = `?${URL_RUN_IDS_PARAM_NAME}=8|#|a_9`; + expect(getRunIdsFromUrl('8')).toEqual({ + executionFlowId: '8', + executionId: '8|#|a', + stepId: '9', + }); + }); + + it('getRunIds should return the correct query param when there is no flow Id', () => { + Object.defineProperty(window, 'location', { + writable: true, + value: new URL('http://localhost'), + }); + window.location.search = `?${URL_RUN_IDS_PARAM_NAME}=8|#|a_9`; + expect(getRunIdsFromUrl('')).toEqual({ + executionFlowId: '8', + executionId: '', + stepId: '', + }); }); + + it('getRunIds should return the correct query param when exec id is wrong', () => { + Object.defineProperty(window, 'location', { + writable: true, + value: new URL('http://localhost'), + }); + window.location.search = `?${URL_RUN_IDS_PARAM_NAME}=8`; + expect(getRunIdsFromUrl('8')).toEqual({ + executionFlowId: '', + executionId: '8', + stepId: '', + }); + }); + it('setRunIds should pushstate new URL with query param', () => { Object.defineProperty(window, 'location', { writable: true, diff --git a/packages/widgets/user-profile-widget/package.json b/packages/widgets/user-profile-widget/package.json index 2b8d5fbae..bd9a6e255 100644 --- a/packages/widgets/user-profile-widget/package.json +++ b/packages/widgets/user-profile-widget/package.json @@ -7,7 +7,7 @@ "url": "https://github.com/descope/descope-js/issues", "email": "help@descope.com" }, - "main": "dist/index.js", + "main": "dist/cjs/index.js", "module": "dist/esm/index.js", "types": "dist/index.d.ts", "description": "Descope user profile widget", diff --git a/packages/widgets/user-profile-widget/rollup.config.mjs b/packages/widgets/user-profile-widget/rollup.config.mjs index 6f6b5863b..0c34cfe0f 100644 --- a/packages/widgets/user-profile-widget/rollup.config.mjs +++ b/packages/widgets/user-profile-widget/rollup.config.mjs @@ -39,6 +39,8 @@ export default [ }), typescript({ rootDir: './src/lib', + declarationDir: 'dist/dts', + declaration: true, }), commonjs(), nodeResolve(), @@ -55,16 +57,20 @@ export default [ }, { input, - output: { - dir: 'dist/esm', - format: 'esm', - sourcemap: true, - }, + output: [ + { + dir: 'dist/esm', + format: 'esm', + sourcemap: true, + }, + { + dir: 'dist/cjs', + format: 'cjs', + sourcemap: true, + }, + ], plugins: [ - typescript({ - rootDir: './src/lib', - declarationDir: 'dist/esm/dts', - }), + typescript(), define({ replacements: { BUILD_VERSION: JSON.stringify(packageJson.version), diff --git a/packages/widgets/user-profile-widget/src/lib/widget/index.ts b/packages/widgets/user-profile-widget/src/lib/widget/index.ts index dea7ac28a..70d88cf82 100644 --- a/packages/widgets/user-profile-widget/src/lib/widget/index.ts +++ b/packages/widgets/user-profile-widget/src/lib/widget/index.ts @@ -1,5 +1,4 @@ import { compose } from '@descope/sdk-helpers'; -import WebComponent from '@descope/web-component'; import { initMixin } from './mixins/initMixin/initMixin'; declare const BUILD_VERSION: string; @@ -8,6 +7,13 @@ const rootMixin = (superclass: CustomElementConstructor) => class RootMixinClass extends initMixin(superclass) { async init() { await super.init?.(); + + const WebComponent: any = + customElements.get('descope-wc') || + (await import('@descope/web-component').then( + (module) => module.default, + )); + WebComponent.sdkConfigOverrides = { baseHeaders: { 'x-descope-widget-type': 'user-profile-widget', diff --git a/packages/widgets/user-profile-widget/tsconfig.json b/packages/widgets/user-profile-widget/tsconfig.json index aab36c601..a3b0373c9 100644 --- a/packages/widgets/user-profile-widget/tsconfig.json +++ b/packages/widgets/user-profile-widget/tsconfig.json @@ -11,8 +11,7 @@ "moduleResolution": "node", "resolveJsonModule": true, "isolatedModules": true, - "declaration": true, - "declarationDir": "dist/dts", + "declaration": false, "noErrorTruncation": true, "typeRoots": ["./node_modules/@types"] }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 15af222be..c6b4a0f7f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1072,7 +1072,7 @@ importers: dependencies: '@descope/nextjs-sdk': specifier: file:../.. - version: file:packages/sdks/nextjs-sdk(@types/react@19.0.1)(next@14.2.10)(react@18.3.1) + version: file:packages/sdks/nextjs-sdk(@types/react@19.0.2)(next@14.2.10)(react@18.3.1) next: specifier: ^14.2.10 version: 14.2.10(@babel/core@7.26.0)(react-dom@18.3.1)(react@18.3.1) @@ -1087,7 +1087,7 @@ importers: dependencies: '@descope/nextjs-sdk': specifier: file:../.. - version: file:packages/sdks/nextjs-sdk(@types/react@19.0.1)(next@14.2.10)(react@18.3.1) + version: file:packages/sdks/nextjs-sdk(@types/react@19.0.2)(next@14.2.10)(react@18.3.1) next: specifier: 14.2.10 version: 14.2.10(@babel/core@7.26.0)(react-dom@18.3.1)(react@18.3.1) @@ -7773,8 +7773,8 @@ packages: - supports-color dev: true - /@descope/web-js-sdk@1.22.0: - resolution: {integrity: sha512-pB4sqCMNBAM4XxmrUXnwJ8BvWATmyfvuA/O9o1ktxMAxUh+IHVuRABcBSB55SX30k82JCQ5g/J11x6CUOMulyw==} + /@descope/web-js-sdk@1.23.0: + resolution: {integrity: sha512-ABfXKFq+e8eRNB/uO5jeUEuK0Iga7FdP+oY7C7K/9S6imySPUXRn/TH/br6Wr57xE9XpVfZtK6KnQvPIH+/3Pg==} requiresBuild: true dependencies: '@descope/core-js-sdk': 2.33.0 @@ -9726,14 +9726,6 @@ packages: - nx dev: true - /@nrwl/devkit@19.3.2(nx@19.3.2): - resolution: {integrity: sha512-n3tFalVPUk1HAJ2VYNnF34yzB9j2+6swFUi4Y92PxD1vN7vrIXnNeaTx2qcee7JDjBpiJ7Zn0KLg2jwiH6hNwA==} - dependencies: - '@nx/devkit': 19.3.2(nx@19.3.2) - transitivePeerDependencies: - - nx - dev: true - /@nrwl/devkit@19.3.2(nx@19.5.2): resolution: {integrity: sha512-n3tFalVPUk1HAJ2VYNnF34yzB9j2+6swFUi4Y92PxD1vN7vrIXnNeaTx2qcee7JDjBpiJ7Zn0KLg2jwiH6hNwA==} dependencies: @@ -9931,7 +9923,7 @@ packages: peerDependencies: nx: '>= 17 <= 20' dependencies: - '@nrwl/devkit': 19.3.2(nx@19.3.2) + '@nrwl/devkit': 19.3.2(nx@19.5.2) ejs: 3.1.9 enquirer: 2.3.6 ignore: 5.3.2 @@ -12190,8 +12182,8 @@ packages: csstype: 3.1.3 dev: true - /@types/react@19.0.1: - resolution: {integrity: sha512-YW6614BDhqbpR5KtUYzTA+zlA7nayzJRA9ljz9CQoxthR0sDisYZLuvSMsil36t4EH/uAt8T52Xb4sVw17G+SQ==} + /@types/react@19.0.2: + resolution: {integrity: sha512-USU8ZI/xyKJwFTpjSVIrSeHBVAGagkHQKPNbxeWwql/vDmnTIBgx+TJnhFnj1NXgz8XfprU0egV2dROLGpsBEg==} dependencies: csstype: 3.1.3 dev: false @@ -15284,7 +15276,7 @@ packages: es-abstract: 1.23.6 es-errors: 1.3.0 get-intrinsic: 1.2.6 - is-array-buffer: 3.0.4 + is-array-buffer: 3.0.5 dev: true /arrify@2.0.1: @@ -16075,8 +16067,8 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001689 - electron-to-chromium: 1.5.73 + caniuse-lite: 1.0.30001690 + electron-to-chromium: 1.5.74 node-releases: 2.0.19 update-browserslist-db: 1.1.1(browserslist@4.24.3) @@ -16295,8 +16287,8 @@ packages: /caniuse-lite@1.0.30001672: resolution: {integrity: sha512-XhW1vRo1ob6aeK2w3rTohwTPBLse/rvjq+s3RTSBwnlZqoFFjx9cHsShJjAIbLsLjyoacaTxpLZy9v3gg6zypw==} - /caniuse-lite@1.0.30001689: - resolution: {integrity: sha512-CmeR2VBycfa+5/jOfnp/NpWPGd06nf1XYiefUvhXFfZE4GkRc9jv+eGPS4nT558WS/8lYCzV8SlANCIPvbWP1g==} + /caniuse-lite@1.0.30001690: + resolution: {integrity: sha512-5ExiE3qQN6oF8Clf8ifIDcMRCRE/dMGcETG/XGMD8/XiXm6HXQgQTh1yZYLXXpSOsEUlJm1Xr7kGULZTuGtP/w==} /case-sensitive-paths-webpack-plugin@2.4.0: resolution: {integrity: sha512-roIFONhcxog0JSSWbvVAh3OocukmSgpqOH6YpMkCvav/ySIV3JKg4Dc8vYtQjYi/UxpNE36r/9v+VqTQqgkYmw==} @@ -17651,6 +17643,15 @@ packages: is-data-view: 1.0.1 dev: true + /data-view-byte-offset@1.0.1: + resolution: {integrity: sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bound: 1.0.3 + es-errors: 1.3.0 + is-data-view: 1.0.2 + dev: true + /debounce@1.2.1: resolution: {integrity: sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==} dev: true @@ -18072,8 +18073,8 @@ packages: engines: {node: '>=12'} dev: true - /dunder-proto@1.0.0: - resolution: {integrity: sha512-9+Sj30DIu+4KvHqMfLUGLFYL2PkURSYMVXJyXe92nFRvlYq5hBjLEhblKB+vkd/WVlUYMWigiY07T91Fkk0+4A==} + /dunder-proto@1.0.1: + resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} engines: {node: '>= 0.4'} dependencies: call-bind-apply-helpers: 1.0.1 @@ -18151,8 +18152,8 @@ packages: resolution: {integrity: sha512-VbeVexmZ1IFh+5EfrYz1I0HTzHVIlJa112UEWhciPyeOcKJGeTv6N8WnG4wsQB81DGCaVEGhpSb6o6a8WYFXXg==} dev: true - /electron-to-chromium@1.5.73: - resolution: {integrity: sha512-8wGNxG9tAG5KhGd3eeA0o6ixhiNdgr0DcHWm85XPCphwZgD1lIEoi6t3VERayWao7SF7AAZTw6oARGJeVjH8Kg==} + /electron-to-chromium@1.5.74: + resolution: {integrity: sha512-ck3//9RC+6oss/1Bh9tiAVFy5vfSKbRHAFh7Z3/eTRkEqJeWgymloShB17Vg3Z4nmDNp35vAd1BZ6CMW4Wt6Iw==} /element-internals-polyfill@1.3.11: resolution: {integrity: sha512-SQLQNVY4wMdpnP/F/HtalJbpEenQd46Avtjm5hvUdeTs3QU0zHFNX5/AmtQIPPcfzePb0ipCkQGY4GwYJIhLJA==} @@ -18365,7 +18366,7 @@ packages: call-bound: 1.0.3 data-view-buffer: 1.0.1 data-view-byte-length: 1.0.1 - data-view-byte-offset: 1.0.0 + data-view-byte-offset: 1.0.1 es-define-property: 1.0.1 es-errors: 1.3.0 es-object-atoms: 1.0.0 @@ -18373,7 +18374,7 @@ packages: es-to-primitive: 1.3.0 function.prototype.name: 1.1.7 get-intrinsic: 1.2.6 - get-symbol-description: 1.0.2 + get-symbol-description: 1.1.0 globalthis: 1.0.4 gopd: 1.2.0 has-property-descriptors: 1.0.2 @@ -18381,31 +18382,31 @@ packages: has-symbols: 1.1.0 hasown: 2.0.2 internal-slot: 1.1.0 - is-array-buffer: 3.0.4 + is-array-buffer: 3.0.5 is-callable: 1.2.7 is-data-view: 1.0.2 is-negative-zero: 2.0.3 is-regex: 1.2.1 - is-shared-array-buffer: 1.0.3 + is-shared-array-buffer: 1.0.4 is-string: 1.1.1 - is-typed-array: 1.1.13 + is-typed-array: 1.1.15 is-weakref: 1.1.0 - math-intrinsics: 1.0.0 + math-intrinsics: 1.1.0 object-inspect: 1.13.3 object-keys: 1.1.1 - object.assign: 4.1.5 + object.assign: 4.1.7 regexp.prototype.flags: 1.5.3 safe-array-concat: 1.1.3 safe-regex-test: 1.1.0 string.prototype.trim: 1.2.10 string.prototype.trimend: 1.0.9 string.prototype.trimstart: 1.0.8 - typed-array-buffer: 1.0.2 - typed-array-byte-length: 1.0.1 - typed-array-byte-offset: 1.0.3 + typed-array-buffer: 1.0.3 + typed-array-byte-length: 1.0.3 + typed-array-byte-offset: 1.0.4 typed-array-length: 1.0.7 unbox-primitive: 1.1.0 - which-typed-array: 1.1.16 + which-typed-array: 1.1.18 dev: true /es-define-property@1.0.0: @@ -19998,7 +19999,7 @@ packages: minimatch: 3.1.2 object.entries: 1.1.8 object.fromentries: 2.0.8 - object.values: 1.2.0 + object.values: 1.2.1 prop-types: 15.8.1 resolve: 2.0.0-next.5 semver: 6.3.1 @@ -21077,7 +21078,7 @@ packages: engines: {node: '>= 0.4'} dependencies: call-bind-apply-helpers: 1.0.1 - dunder-proto: 1.0.0 + dunder-proto: 1.0.1 es-define-property: 1.0.1 es-errors: 1.3.0 es-object-atoms: 1.0.0 @@ -21085,7 +21086,7 @@ packages: gopd: 1.2.0 has-symbols: 1.1.0 hasown: 2.0.2 - math-intrinsics: 1.0.0 + math-intrinsics: 1.1.0 dev: true /get-package-type@0.1.0: @@ -21131,6 +21132,15 @@ packages: get-intrinsic: 1.2.4 dev: true + /get-symbol-description@1.1.0: + resolution: {integrity: sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==} + engines: {node: '>= 0.4'} + dependencies: + call-bound: 1.0.3 + es-errors: 1.3.0 + get-intrinsic: 1.2.6 + dev: true + /get-tsconfig@4.7.3: resolution: {integrity: sha512-ZvkrzoUA0PQZM6fy6+/Hce561s+faD1rsNwhnO5FelNjyy7EMGJ3Rz1AQ8GYDWjhRs/7dBLOEJvhK8MiEJOAFg==} dependencies: @@ -21377,6 +21387,11 @@ packages: resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} dev: true + /has-bigints@1.1.0: + resolution: {integrity: sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==} + engines: {node: '>= 0.4'} + dev: true + /has-flag@3.0.0: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} engines: {node: '>=4'} @@ -21402,7 +21417,7 @@ packages: resolution: {integrity: sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==} engines: {node: '>= 0.4'} dependencies: - dunder-proto: 1.0.0 + dunder-proto: 1.0.1 dev: true /has-symbols@1.0.3: @@ -21994,6 +22009,15 @@ packages: get-intrinsic: 1.2.4 dev: true + /is-array-buffer@3.0.5: + resolution: {integrity: sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.8 + call-bound: 1.0.3 + get-intrinsic: 1.2.6 + dev: true + /is-arrayish@0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} dev: true @@ -22023,7 +22047,7 @@ packages: resolution: {integrity: sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==} engines: {node: '>= 0.4'} dependencies: - has-bigints: 1.0.2 + has-bigints: 1.1.0 dev: true /is-binary-path@2.1.0: @@ -22091,7 +22115,7 @@ packages: dependencies: call-bound: 1.0.3 get-intrinsic: 1.2.6 - is-typed-array: 1.1.13 + is-typed-array: 1.1.15 dev: true /is-date-object@1.0.5: @@ -22137,11 +22161,11 @@ packages: call-bind: 1.0.7 dev: true - /is-finalizationregistry@1.1.0: - resolution: {integrity: sha512-qfMdqbAQEwBw78ZyReKnlA8ezmPdb9BemzIIip/JkjaZUhitfXDkkr+3QTboW0JrSXT1QWyYShpvnNHGZ4c4yA==} + /is-finalizationregistry@1.1.1: + resolution: {integrity: sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.8 + call-bound: 1.0.3 dev: true /is-fullwidth-code-point@2.0.0: @@ -22310,6 +22334,13 @@ packages: call-bind: 1.0.7 dev: true + /is-shared-array-buffer@1.0.4: + resolution: {integrity: sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==} + engines: {node: '>= 0.4'} + dependencies: + call-bound: 1.0.3 + dev: true + /is-stream@1.1.0: resolution: {integrity: sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==} engines: {node: '>=0.10.0'} @@ -22370,6 +22401,13 @@ packages: which-typed-array: 1.1.15 dev: true + /is-typed-array@1.1.15: + resolution: {integrity: sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==} + engines: {node: '>= 0.4'} + dependencies: + which-typed-array: 1.1.18 + dev: true + /is-typedarray@1.0.0: resolution: {integrity: sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==} dev: true @@ -22520,7 +22558,7 @@ packages: es-object-atoms: 1.0.0 get-intrinsic: 1.2.6 has-symbols: 1.1.0 - reflect.getprototypeof: 1.0.8 + reflect.getprototypeof: 1.0.9 set-function-name: 2.0.2 dev: true @@ -24476,8 +24514,8 @@ packages: uc.micro: 2.1.0 dev: true - /math-intrinsics@1.0.0: - resolution: {integrity: sha512-4MqMiKP90ybymYvsut0CH2g4XWbfLtmlCkXmtmdcDCxNB+mQcu1w/1+L/VD7vi/PSv7X2JYV7SCcR+jiPXnQtA==} + /math-intrinsics@1.1.0: + resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} engines: {node: '>= 0.4'} dev: true @@ -25587,6 +25625,18 @@ packages: object-keys: 1.1.1 dev: true + /object.assign@4.1.7: + resolution: {integrity: sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.8 + call-bound: 1.0.3 + define-properties: 1.2.1 + es-object-atoms: 1.0.0 + has-symbols: 1.1.0 + object-keys: 1.1.1 + dev: true + /object.entries@1.1.8: resolution: {integrity: sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ==} engines: {node: '>= 0.4'} @@ -25633,6 +25683,16 @@ packages: es-object-atoms: 1.0.0 dev: true + /object.values@1.2.1: + resolution: {integrity: sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.8 + call-bound: 1.0.3 + define-properties: 1.2.1 + es-object-atoms: 1.0.0 + dev: true + /obuf@1.1.2: resolution: {integrity: sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==} dev: true @@ -27107,13 +27167,13 @@ packages: which-builtin-type: 1.1.3 dev: true - /reflect.getprototypeof@1.0.8: - resolution: {integrity: sha512-B5dj6usc5dkk8uFliwjwDHM8To5/QwdKz9JcBZ8Ic4G1f0YmeeJTtE/ZTdgRFPAfxZFiUaPhZ1Jcs4qeagItGQ==} + /reflect.getprototypeof@1.0.9: + resolution: {integrity: sha512-r0Ay04Snci87djAsI4U+WNRcSw5S4pOH7qFjd/veA5gC7TbqESR3tcj28ia95L/fYUDw11JKP7uqUKUAfVvV5Q==} engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.8 define-properties: 1.2.1 - dunder-proto: 1.0.0 + dunder-proto: 1.0.1 es-abstract: 1.23.6 es-errors: 1.3.0 get-intrinsic: 1.2.6 @@ -30242,6 +30302,15 @@ packages: is-typed-array: 1.1.13 dev: true + /typed-array-buffer@1.0.3: + resolution: {integrity: sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==} + engines: {node: '>= 0.4'} + dependencies: + call-bound: 1.0.3 + es-errors: 1.3.0 + is-typed-array: 1.1.15 + dev: true + /typed-array-byte-length@1.0.1: resolution: {integrity: sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==} engines: {node: '>= 0.4'} @@ -30253,6 +30322,17 @@ packages: is-typed-array: 1.1.13 dev: true + /typed-array-byte-length@1.0.3: + resolution: {integrity: sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.8 + for-each: 0.3.3 + gopd: 1.2.0 + has-proto: 1.2.0 + is-typed-array: 1.1.15 + dev: true + /typed-array-byte-offset@1.0.2: resolution: {integrity: sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==} engines: {node: '>= 0.4'} @@ -30265,8 +30345,8 @@ packages: is-typed-array: 1.1.13 dev: true - /typed-array-byte-offset@1.0.3: - resolution: {integrity: sha512-GsvTyUHTriq6o/bHcTd0vM7OQ9JEdlvluu9YISaA7+KzDzPaIzEeDFNkTfhdE3MYcNhNi0vq/LlegYgIs5yPAw==} + /typed-array-byte-offset@1.0.4: + resolution: {integrity: sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==} engines: {node: '>= 0.4'} dependencies: available-typed-arrays: 1.0.7 @@ -30274,8 +30354,8 @@ packages: for-each: 0.3.3 gopd: 1.2.0 has-proto: 1.2.0 - is-typed-array: 1.1.13 - reflect.getprototypeof: 1.0.8 + is-typed-array: 1.1.15 + reflect.getprototypeof: 1.0.9 dev: true /typed-array-length@1.0.6: @@ -30297,9 +30377,9 @@ packages: call-bind: 1.0.8 for-each: 0.3.3 gopd: 1.2.0 - is-typed-array: 1.1.13 + is-typed-array: 1.1.15 possible-typed-array-names: 1.0.0 - reflect.getprototypeof: 1.0.8 + reflect.getprototypeof: 1.0.9 dev: true /typed-assert@1.0.9: @@ -30372,7 +30452,7 @@ packages: engines: {node: '>= 0.4'} dependencies: call-bound: 1.0.3 - has-bigints: 1.0.2 + has-bigints: 1.1.0 has-symbols: 1.1.0 which-boxed-primitive: 1.1.1 dev: true @@ -31288,14 +31368,14 @@ packages: has-tostringtag: 1.0.2 is-async-function: 2.0.0 is-date-object: 1.1.0 - is-finalizationregistry: 1.1.0 + is-finalizationregistry: 1.1.1 is-generator-function: 1.0.10 is-regex: 1.2.1 is-weakref: 1.1.0 isarray: 2.0.5 which-boxed-primitive: 1.1.1 which-collection: 1.0.2 - which-typed-array: 1.1.16 + which-typed-array: 1.1.18 dev: true /which-collection@1.0.2: @@ -31319,12 +31399,13 @@ packages: has-tostringtag: 1.0.2 dev: true - /which-typed-array@1.1.16: - resolution: {integrity: sha512-g+N+GAWiRj66DngFwHvISJd+ITsyphZvD1vChfVg6cEdnzy53GzB3oy0fUNlvhz7H7+MiqhYr26qxQShCpKTTQ==} + /which-typed-array@1.1.18: + resolution: {integrity: sha512-qEcY+KJYlWyLH9vNbsr6/5j59AXk5ni5aakf8ldzBvGde6Iz4sxZGkJyWSAueTG7QhOvNRYb1lDdFmL5Td0QKA==} engines: {node: '>= 0.4'} dependencies: available-typed-arrays: 1.0.7 call-bind: 1.0.8 + call-bound: 1.0.3 for-each: 0.3.3 gopd: 1.2.0 has-tostringtag: 1.0.2 @@ -31643,7 +31724,7 @@ packages: tslib: 2.6.3 dev: true - file:packages/sdks/nextjs-sdk(@types/react@19.0.1)(next@14.2.10)(react@18.3.1): + file:packages/sdks/nextjs-sdk(@types/react@19.0.2)(next@14.2.10)(react@18.3.1): resolution: {directory: packages/sdks/nextjs-sdk, type: directory} id: file:packages/sdks/nextjs-sdk name: '@descope/nextjs-sdk' @@ -31657,11 +31738,11 @@ packages: '@descope/node-sdk': 1.6.9 '@descope/react-sdk': link:packages/sdks/react-sdk '@descope/web-component': link:packages/sdks/web-component - '@types/react': 19.0.1 + '@types/react': 19.0.2 next: 14.2.10(@babel/core@7.26.0)(react-dom@18.3.1)(react@18.3.1) react: 18.3.1 optionalDependencies: - '@descope/web-js-sdk': 1.22.0 + '@descope/web-js-sdk': 1.23.0 transitivePeerDependencies: - encoding dev: false