@descope/react-sdk 2.6.0 → 2.7.0

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.
Files changed (47) hide show
  1. package/README.md +21 -0
  2. package/dist/cjs/components/AccessKeyManagement.js +1 -1
  3. package/dist/cjs/components/AccessKeyManagement.js.map +1 -1
  4. package/dist/cjs/components/ApplicationsPortal.js +1 -1
  5. package/dist/cjs/components/ApplicationsPortal.js.map +1 -1
  6. package/dist/cjs/components/AuditManagement.js +1 -1
  7. package/dist/cjs/components/AuditManagement.js.map +1 -1
  8. package/dist/cjs/components/AuthProvider/AuthProvider.js +1 -1
  9. package/dist/cjs/components/AuthProvider/AuthProvider.js.map +1 -1
  10. package/dist/cjs/components/AuthProvider/useSdk.js +1 -1
  11. package/dist/cjs/components/AuthProvider/useSdk.js.map +1 -1
  12. package/dist/cjs/components/Descope.js +1 -1
  13. package/dist/cjs/components/Descope.js.map +1 -1
  14. package/dist/cjs/components/RoleManagement.js +1 -1
  15. package/dist/cjs/components/RoleManagement.js.map +1 -1
  16. package/dist/cjs/components/UserManagement.js +1 -1
  17. package/dist/cjs/components/UserManagement.js.map +1 -1
  18. package/dist/cjs/components/UserProfile.js +1 -1
  19. package/dist/cjs/components/UserProfile.js.map +1 -1
  20. package/dist/cjs/constants.js +1 -1
  21. package/dist/esm/components/AccessKeyManagement.js +1 -1
  22. package/dist/esm/components/AccessKeyManagement.js.map +1 -1
  23. package/dist/esm/components/ApplicationsPortal.js +1 -1
  24. package/dist/esm/components/ApplicationsPortal.js.map +1 -1
  25. package/dist/esm/components/AuditManagement.js +1 -1
  26. package/dist/esm/components/AuditManagement.js.map +1 -1
  27. package/dist/esm/components/AuthProvider/AuthProvider.js +1 -1
  28. package/dist/esm/components/AuthProvider/AuthProvider.js.map +1 -1
  29. package/dist/esm/components/AuthProvider/useSdk.js +1 -1
  30. package/dist/esm/components/AuthProvider/useSdk.js.map +1 -1
  31. package/dist/esm/components/Descope.js +1 -1
  32. package/dist/esm/components/Descope.js.map +1 -1
  33. package/dist/esm/components/RoleManagement.js +1 -1
  34. package/dist/esm/components/RoleManagement.js.map +1 -1
  35. package/dist/esm/components/UserManagement.js +1 -1
  36. package/dist/esm/components/UserManagement.js.map +1 -1
  37. package/dist/esm/components/UserProfile.js +1 -1
  38. package/dist/esm/components/UserProfile.js.map +1 -1
  39. package/dist/esm/constants.js +1 -1
  40. package/dist/index.d.ts +5 -3
  41. package/dist/index.umd.js +2 -2
  42. package/dist/index.umd.js.map +1 -1
  43. package/dist/types/components/AuthProvider/AuthProvider.d.ts +1 -0
  44. package/dist/types/components/AuthProvider/useSdk.d.ts +2 -2
  45. package/dist/types/sdk.d.ts +7 -6
  46. package/dist/types/types.d.ts +2 -1
  47. package/package.json +10 -10
@@ -1 +1 @@
1
- {"version":3,"file":"Descope.js","sources":["../../../src/components/Descope.tsx"],"sourcesContent":["import React, {\n lazy,\n Suspense,\n useCallback,\n useEffect,\n useImperativeHandle,\n useState,\n} from 'react';\nimport { baseHeaders } from '../constants';\nimport Context from '../hooks/Context';\nimport { DescopeProps } from '../types';\nimport { getGlobalSdk } from '../sdk';\nimport withPropsMapping from './withPropsMapping';\n\n// web-component code uses browser API, but can be used in SSR apps, hence the lazy loading\nconst DescopeWC = lazy(async () => {\n const WebComponent: any =\n customElements?.get('descope-wc') ||\n (await import('@descope/web-component').then((module) => module.default));\n\n WebComponent.sdkConfigOverrides = {\n // Overrides the web-component's base headers to indicate usage via the React SDK\n baseHeaders,\n // Disables token persistence within the web-component to delegate token management\n // to the global SDK hooks. This ensures token handling aligns with the SDK's configuration,\n // and web-component requests leverage the global SDK's beforeRequest hooks for consistency\n persistTokens: false,\n hooks: {\n get beforeRequest() {\n // Retrieves the beforeRequest hook from the global SDK, which is initialized\n // within the AuthProvider using the desired configuration. This approach ensures\n // the web-component utilizes the same beforeRequest hooks as the global SDK\n return getGlobalSdk().httpClient.hooks.beforeRequest;\n },\n set beforeRequest(_) {\n // The empty setter prevents runtime errors when attempts are made to assign a value to 'beforeRequest'.\n // JavaScript objects default to having both getters and setters\n },\n },\n };\n\n return {\n default: withPropsMapping(\n React.forwardRef<HTMLElement>((props, ref) => (\n\t<descope-wc ref={ref} {...props} />\n )),\n ),\n };\n});\n\nconst Descope = React.forwardRef<HTMLElement, DescopeProps>(\n (\n {\n flowId,\n onSuccess,\n onError,\n onReady,\n logger,\n tenant,\n theme,\n locale,\n debug,\n client,\n form,\n telemetryKey,\n redirectUrl,\n autoFocus,\n validateOnBlur,\n restartOnError,\n errorTransformer,\n styleId,\n onScreenUpdate,\n children,\n },\n ref,\n ) => {\n const [innerRef, setInnerRef] = useState(null);\n\n useImperativeHandle(ref, () => innerRef);\n\n const {\n projectId,\n baseUrl,\n baseStaticUrl,\n baseCdnUrl,\n storeLastAuthenticatedUser,\n keepLastAuthenticatedUserAfterLogout,\n sdk,\n } = React.useContext(Context);\n\n const handleSuccess = useCallback(\n async (e: CustomEvent) => {\n // In order to make sure all the after-hooks are running with the success response\n // we are generating a fake response with the success data and calling the http client after hook fn with it\n await sdk.httpClient.hooks.afterRequest(\n {} as any,\n new Response(JSON.stringify(e.detail)),\n );\n if (onSuccess) {\n onSuccess(e);\n }\n },\n [onSuccess],\n );\n\n useEffect(() => {\n const ele = innerRef;\n ele?.addEventListener('success', handleSuccess);\n if (onError) ele?.addEventListener('error', onError);\n if (onReady) ele?.addEventListener('ready', onReady);\n\n return () => {\n if (onError) ele?.removeEventListener('error', onError);\n if (onReady) ele?.removeEventListener('ready', onReady);\n\n ele?.removeEventListener('success', handleSuccess);\n };\n }, [innerRef, onError, handleSuccess]);\n\n // Success event\n useEffect(() => {\n const ele = innerRef;\n ele?.addEventListener('success', handleSuccess);\n return () => {\n ele?.removeEventListener('success', handleSuccess);\n };\n }, [innerRef, handleSuccess]);\n\n // Error event\n useEffect(() => {\n const ele = innerRef;\n if (onError) ele?.addEventListener('error', onError);\n\n return () => {\n if (onError) ele?.removeEventListener('error', onError);\n };\n }, [innerRef, onError]);\n\n // Ready event\n useEffect(() => {\n const ele = innerRef;\n if (onReady) ele?.addEventListener('ready', onReady);\n\n return () => {\n if (onReady) ele?.removeEventListener('error', onReady);\n };\n }, [innerRef, onReady]);\n\n return (\n /**\n * in order to avoid redundant remounting of the WC, we are wrapping it with a form element\n * this workaround is done in order to support webauthn passkeys\n * it can be removed once this issue will be solved\n * https://bugs.chromium.org/p/chromium/issues/detail?id=1404106#c2\n */\n\t<form>\n\t\t<Suspense fallback={null}>\n\t\t\t<DescopeWC\n projectId={projectId}\n flowId={flowId}\n baseUrl={baseUrl}\n baseStaticUrl={baseStaticUrl}\n baseCdnUrl={baseCdnUrl}\n ref={setInnerRef}\n telemetryKey={telemetryKey}\n redirectUrl={redirectUrl}\n autoFocus={autoFocus}\n styleId={styleId}\n validateOnBlur={validateOnBlur}\n restartOnError={restartOnError}\n keepLastAuthenticatedUserAfterLogout={\n keepLastAuthenticatedUserAfterLogout\n }\n tenant={tenant}\n {...{\n // attributes\n 'theme.attr': theme,\n 'locale.attr': locale,\n 'form.attr': form,\n 'client.attr': client,\n 'debug.attr': debug,\n 'store-last-authenticated-user.attr': storeLastAuthenticatedUser,\n // props\n 'errorTransformer.prop': errorTransformer,\n 'logger.prop': logger,\n 'onScreenUpdate.prop': onScreenUpdate,\n }}\n >\n\t\t\t\t{children}\n\t\t\t</DescopeWC>\n\t\t</Suspense>\n\t</form>\n );\n },\n);\n\nexport default Descope;\n"],"names":["DescopeWC","lazy","async","customElements","get","import","then","module","default","sdkConfigOverrides","baseHeaders","persistTokens","hooks","beforeRequest","getGlobalSdk","httpClient","_","withPropsMapping","React","forwardRef","props","ref","createElement","Object","assign","Descope","flowId","onSuccess","onError","onReady","logger","tenant","theme","locale","debug","client","form","telemetryKey","redirectUrl","autoFocus","validateOnBlur","restartOnError","errorTransformer","styleId","onScreenUpdate","children","innerRef","setInnerRef","useState","useImperativeHandle","projectId","baseUrl","baseStaticUrl","baseCdnUrl","storeLastAuthenticatedUser","keepLastAuthenticatedUserAfterLogout","sdk","useContext","Context","handleSuccess","useCallback","e","afterRequest","Response","JSON","stringify","detail","useEffect","ele","addEventListener","removeEventListener","Suspense","fallback"],"mappings":"0RAeA,MAAMA,EAAYC,GAAKC,YAEnB,OAAAC,qBAAA,IAAAA,oBAAA,EAAAA,eAAgBC,IAAI,sBACbC,OAAO,0BAA0BC,MAAMC,GAAWA,EAAOC,WAErDC,mBAAqB,CAEhCC,cAIAC,eAAe,EACfC,MAAO,CACL,iBAAIC,GAIF,OAAOC,IAAeC,WAAWH,MAAMC,aACxC,EACD,iBAAIA,CAAcG,GAGjB,IAIE,CACLR,QAASS,EACPC,EAAMC,YAAwB,CAACC,EAAOC,IAC3CH,EAAYI,cAAA,aAAAC,OAAAC,OAAA,CAAAH,IAAKA,GAASD,WAMrBK,EAAUP,EAAMC,YACpB,EAEIO,SACAC,YACAC,UACAC,UACAC,SACAC,SACAC,QACAC,SACAC,QACAC,SACAC,OACAC,eACAC,cACAC,YACAC,iBACAC,iBACAC,mBACAC,UACAC,iBACAC,YAEFxB,KAEA,MAAOyB,EAAUC,GAAeC,EAAS,MAEzCC,EAAoB5B,GAAK,IAAMyB,IAE/B,MAAMI,UACJA,EAASC,QACTA,EAAOC,cACPA,EAAaC,WACbA,EAAUC,2BACVA,EAA0BC,qCAC1BA,EAAoCC,IACpCA,GACEtC,EAAMuC,WAAWC,GAEfC,EAAgBC,GACpB1D,MAAO2D,UAGCL,EAAIzC,WAAWH,MAAMkD,aACzB,CAAA,EACA,IAAIC,SAASC,KAAKC,UAAUJ,EAAEK,UAE5BvC,GACFA,EAAUkC,EACX,GAEH,CAAClC,IA8CH,OA3CAwC,GAAU,KACR,MAAMC,EAAMtB,EAKZ,OAJAsB,SAAAA,EAAKC,iBAAiB,UAAWV,GAC7B/B,IAASwC,SAAAA,EAAKC,iBAAiB,QAASzC,IACxCC,IAASuC,SAAAA,EAAKC,iBAAiB,QAASxC,IAErC,KACDD,IAASwC,SAAAA,EAAKE,oBAAoB,QAAS1C,IAC3CC,IAASuC,SAAAA,EAAKE,oBAAoB,QAASzC,IAE/CuC,SAAAA,EAAKE,oBAAoB,UAAWX,EAAc,CACnD,GACA,CAACb,EAAUlB,EAAS+B,IAGvBQ,GAAU,KACR,MAAMC,EAAMtB,EAEZ,OADAsB,SAAAA,EAAKC,iBAAiB,UAAWV,GAC1B,KACLS,SAAAA,EAAKE,oBAAoB,UAAWX,EAAc,CACnD,GACA,CAACb,EAAUa,IAGdQ,GAAU,KACR,MAAMC,EAAMtB,EAGZ,OAFIlB,IAASwC,SAAAA,EAAKC,iBAAiB,QAASzC,IAErC,KACDA,IAASwC,SAAAA,EAAKE,oBAAoB,QAAS1C,GAAQ,CACxD,GACA,CAACkB,EAAUlB,IAGduC,GAAU,KACR,MAAMC,EAAMtB,EAGZ,OAFIjB,IAASuC,SAAAA,EAAKC,iBAAiB,QAASxC,IAErC,KACDA,IAASuC,SAAAA,EAAKE,oBAAoB,QAASzC,GAAQ,CACxD,GACA,CAACiB,EAAUjB,IASjBX,EAAAI,cAAA,OAAA,KACCJ,EAAAI,cAACiD,EAAQ,CAACC,SAAU,MACnBtD,EAACI,cAAAtB,EACQ,CAAAkD,UAAWA,EACXxB,OAAQA,EACRyB,QAASA,EACTC,cAAeA,EACfC,WAAYA,EACZhC,IAAK0B,EACLV,aAAcA,EACdC,YAAaA,EACbC,UAAWA,EACXI,QAASA,EACTH,eAAgBA,EAChBC,eAAgBA,EAChBc,qCACEA,EAEFxB,OAAQA,EAGN,aAAcC,EACd,cAAeC,EACf,YAAaG,EACb,cAAeD,EACf,aAAcD,EACd,qCAAsCoB,EAEtC,wBAAyBZ,EACzB,cAAeZ,EACf,sBAAuBc,GAGhCC,IAIC"}
1
+ {"version":3,"file":"Descope.js","sources":["../../../src/components/Descope.tsx"],"sourcesContent":["import React, {\n lazy,\n Suspense,\n useCallback,\n useEffect,\n useImperativeHandle,\n useState,\n} from 'react';\nimport { baseHeaders } from '../constants';\nimport Context from '../hooks/Context';\nimport { DescopeProps } from '../types';\nimport { getGlobalSdk } from '../sdk';\nimport withPropsMapping from './withPropsMapping';\n\n// web-component code uses browser API, but can be used in SSR apps, hence the lazy loading\nconst DescopeWC = lazy(async () => {\n const WebComponent: any =\n customElements?.get('descope-wc') ||\n (await import('@descope/web-component').then((module) => module.default));\n\n WebComponent.sdkConfigOverrides = {\n // Overrides the web-component's base headers to indicate usage via the React SDK\n baseHeaders,\n // Disables token persistence within the web-component to delegate token management\n // to the global SDK hooks. This ensures token handling aligns with the SDK's configuration,\n // and web-component requests leverage the global SDK's beforeRequest hooks for consistency\n persistTokens: false,\n hooks: {\n get beforeRequest() {\n // Retrieves the beforeRequest hook from the global SDK, which is initialized\n // within the AuthProvider using the desired configuration. This approach ensures\n // the web-component utilizes the same beforeRequest hooks as the global SDK\n return getGlobalSdk().httpClient.hooks.beforeRequest;\n },\n set beforeRequest(_) {\n // The empty setter prevents runtime errors when attempts are made to assign a value to 'beforeRequest'.\n // JavaScript objects default to having both getters and setters\n },\n },\n };\n\n return {\n default: withPropsMapping(\n React.forwardRef<HTMLElement>((props, ref) => (\n\t<descope-wc ref={ref} {...props} />\n )),\n ),\n };\n});\n\nconst Descope = React.forwardRef<HTMLElement, DescopeProps>(\n (\n {\n flowId,\n onSuccess,\n onError,\n onReady,\n logger,\n tenant,\n theme,\n locale,\n debug,\n client,\n form,\n telemetryKey,\n redirectUrl,\n autoFocus,\n validateOnBlur,\n restartOnError,\n errorTransformer,\n styleId,\n onScreenUpdate,\n children,\n },\n ref,\n ) => {\n const [innerRef, setInnerRef] = useState(null);\n\n useImperativeHandle(ref, () => innerRef);\n\n const {\n projectId,\n baseUrl,\n baseStaticUrl,\n baseCdnUrl,\n storeLastAuthenticatedUser,\n keepLastAuthenticatedUserAfterLogout,\n refreshCookieName,\n sdk,\n } = React.useContext(Context);\n\n const handleSuccess = useCallback(\n async (e: CustomEvent) => {\n // In order to make sure all the after-hooks are running with the success response\n // we are generating a fake response with the success data and calling the http client after hook fn with it\n await sdk.httpClient.hooks.afterRequest(\n {} as any,\n new Response(JSON.stringify(e.detail)),\n );\n if (onSuccess) {\n onSuccess(e);\n }\n },\n [onSuccess],\n );\n\n useEffect(() => {\n const ele = innerRef;\n ele?.addEventListener('success', handleSuccess);\n if (onError) ele?.addEventListener('error', onError);\n if (onReady) ele?.addEventListener('ready', onReady);\n\n return () => {\n if (onError) ele?.removeEventListener('error', onError);\n if (onReady) ele?.removeEventListener('ready', onReady);\n\n ele?.removeEventListener('success', handleSuccess);\n };\n }, [innerRef, onError, handleSuccess]);\n\n // Success event\n useEffect(() => {\n const ele = innerRef;\n ele?.addEventListener('success', handleSuccess);\n return () => {\n ele?.removeEventListener('success', handleSuccess);\n };\n }, [innerRef, handleSuccess]);\n\n // Error event\n useEffect(() => {\n const ele = innerRef;\n if (onError) ele?.addEventListener('error', onError);\n\n return () => {\n if (onError) ele?.removeEventListener('error', onError);\n };\n }, [innerRef, onError]);\n\n // Ready event\n useEffect(() => {\n const ele = innerRef;\n if (onReady) ele?.addEventListener('ready', onReady);\n\n return () => {\n if (onReady) ele?.removeEventListener('error', onReady);\n };\n }, [innerRef, onReady]);\n\n return (\n /**\n * in order to avoid redundant remounting of the WC, we are wrapping it with a form element\n * this workaround is done in order to support webauthn passkeys\n * it can be removed once this issue will be solved\n * https://bugs.chromium.org/p/chromium/issues/detail?id=1404106#c2\n */\n\t<form>\n\t\t<Suspense fallback={null}>\n\t\t\t<DescopeWC\n projectId={projectId}\n flowId={flowId}\n baseUrl={baseUrl}\n baseStaticUrl={baseStaticUrl}\n baseCdnUrl={baseCdnUrl}\n ref={setInnerRef}\n telemetryKey={telemetryKey}\n redirectUrl={redirectUrl}\n autoFocus={autoFocus}\n styleId={styleId}\n validateOnBlur={validateOnBlur}\n restartOnError={restartOnError}\n keepLastAuthenticatedUserAfterLogout={\n keepLastAuthenticatedUserAfterLogout\n }\n tenant={tenant}\n {...{\n // attributes\n 'theme.attr': theme,\n 'locale.attr': locale,\n 'form.attr': form,\n 'client.attr': client,\n 'debug.attr': debug,\n 'store-last-authenticated-user.attr': storeLastAuthenticatedUser,\n 'refreshCookieName.attr': refreshCookieName,\n // props\n 'errorTransformer.prop': errorTransformer,\n 'logger.prop': logger,\n 'onScreenUpdate.prop': onScreenUpdate,\n }}\n >\n\t\t\t\t{children}\n\t\t\t</DescopeWC>\n\t\t</Suspense>\n\t</form>\n );\n },\n);\n\nexport default Descope;\n"],"names":["DescopeWC","lazy","async","customElements","get","import","then","module","default","sdkConfigOverrides","baseHeaders","persistTokens","hooks","beforeRequest","getGlobalSdk","httpClient","_","withPropsMapping","React","forwardRef","props","ref","createElement","Object","assign","Descope","flowId","onSuccess","onError","onReady","logger","tenant","theme","locale","debug","client","form","telemetryKey","redirectUrl","autoFocus","validateOnBlur","restartOnError","errorTransformer","styleId","onScreenUpdate","children","innerRef","setInnerRef","useState","useImperativeHandle","projectId","baseUrl","baseStaticUrl","baseCdnUrl","storeLastAuthenticatedUser","keepLastAuthenticatedUserAfterLogout","refreshCookieName","sdk","useContext","Context","handleSuccess","useCallback","e","afterRequest","Response","JSON","stringify","detail","useEffect","ele","addEventListener","removeEventListener","Suspense","fallback"],"mappings":"0RAeA,MAAMA,EAAYC,GAAKC,YAEnB,OAAAC,qBAAA,IAAAA,oBAAA,EAAAA,eAAgBC,IAAI,sBACbC,OAAO,0BAA0BC,MAAMC,GAAWA,EAAOC,WAErDC,mBAAqB,CAEhCC,cAIAC,eAAe,EACfC,MAAO,CACL,iBAAIC,GAIF,OAAOC,IAAeC,WAAWH,MAAMC,aACxC,EACD,iBAAIA,CAAcG,GAGjB,IAIE,CACLR,QAASS,EACPC,EAAMC,YAAwB,CAACC,EAAOC,IAC3CH,EAAYI,cAAA,aAAAC,OAAAC,OAAA,CAAAH,IAAKA,GAASD,WAMrBK,EAAUP,EAAMC,YACpB,EAEIO,SACAC,YACAC,UACAC,UACAC,SACAC,SACAC,QACAC,SACAC,QACAC,SACAC,OACAC,eACAC,cACAC,YACAC,iBACAC,iBACAC,mBACAC,UACAC,iBACAC,YAEFxB,KAEA,MAAOyB,EAAUC,GAAeC,EAAS,MAEzCC,EAAoB5B,GAAK,IAAMyB,IAE/B,MAAMI,UACJA,EAASC,QACTA,EAAOC,cACPA,EAAaC,WACbA,EAAUC,2BACVA,EAA0BC,qCAC1BA,EAAoCC,kBACpCA,EAAiBC,IACjBA,GACEvC,EAAMwC,WAAWC,GAEfC,EAAgBC,GACpB3D,MAAO4D,UAGCL,EAAI1C,WAAWH,MAAMmD,aACzB,CAAA,EACA,IAAIC,SAASC,KAAKC,UAAUJ,EAAEK,UAE5BxC,GACFA,EAAUmC,EACX,GAEH,CAACnC,IA8CH,OA3CAyC,GAAU,KACR,MAAMC,EAAMvB,EAKZ,OAJAuB,SAAAA,EAAKC,iBAAiB,UAAWV,GAC7BhC,IAASyC,SAAAA,EAAKC,iBAAiB,QAAS1C,IACxCC,IAASwC,SAAAA,EAAKC,iBAAiB,QAASzC,IAErC,KACDD,IAASyC,SAAAA,EAAKE,oBAAoB,QAAS3C,IAC3CC,IAASwC,SAAAA,EAAKE,oBAAoB,QAAS1C,IAE/CwC,SAAAA,EAAKE,oBAAoB,UAAWX,EAAc,CACnD,GACA,CAACd,EAAUlB,EAASgC,IAGvBQ,GAAU,KACR,MAAMC,EAAMvB,EAEZ,OADAuB,SAAAA,EAAKC,iBAAiB,UAAWV,GAC1B,KACLS,SAAAA,EAAKE,oBAAoB,UAAWX,EAAc,CACnD,GACA,CAACd,EAAUc,IAGdQ,GAAU,KACR,MAAMC,EAAMvB,EAGZ,OAFIlB,IAASyC,SAAAA,EAAKC,iBAAiB,QAAS1C,IAErC,KACDA,IAASyC,SAAAA,EAAKE,oBAAoB,QAAS3C,GAAQ,CACxD,GACA,CAACkB,EAAUlB,IAGdwC,GAAU,KACR,MAAMC,EAAMvB,EAGZ,OAFIjB,IAASwC,SAAAA,EAAKC,iBAAiB,QAASzC,IAErC,KACDA,IAASwC,SAAAA,EAAKE,oBAAoB,QAAS1C,GAAQ,CACxD,GACA,CAACiB,EAAUjB,IASjBX,EAAAI,cAAA,OAAA,KACCJ,EAAAI,cAACkD,EAAQ,CAACC,SAAU,MACnBvD,EAACI,cAAAtB,EACQ,CAAAkD,UAAWA,EACXxB,OAAQA,EACRyB,QAASA,EACTC,cAAeA,EACfC,WAAYA,EACZhC,IAAK0B,EACLV,aAAcA,EACdC,YAAaA,EACbC,UAAWA,EACXI,QAASA,EACTH,eAAgBA,EAChBC,eAAgBA,EAChBc,qCACEA,EAEFxB,OAAQA,EAGN,aAAcC,EACd,cAAeC,EACf,YAAaG,EACb,cAAeD,EACf,aAAcD,EACd,qCAAsCoB,EACtC,yBAA0BE,EAE1B,wBAAyBd,EACzB,cAAeZ,EACf,sBAAuBc,GAGhCC,IAIC"}
@@ -1,2 +1,2 @@
1
- import e,{lazy as t,useState as r,useImperativeHandle as a,Suspense as n}from"react";import o from"../hooks/Context.js";import l from"./withPropsMapping/index.js";const s=t((async()=>(await import("@descope/role-management-widget"),{default:l(e.forwardRef(((t,r)=>e.createElement("descope-role-management-widget",Object.assign({ref:r},t)))))}))),d=e.forwardRef((({logger:t,tenant:l,theme:d,debug:c,widgetId:i,styleId:m},g)=>{const[p,f]=r(null);a(g,(()=>p));const{projectId:b,baseUrl:u,baseStaticUrl:w,baseCdnUrl:I}=e.useContext(o);return e.createElement(n,{fallback:null},e.createElement(s,{projectId:b,widgetId:i,tenant:l,baseUrl:u,baseStaticUrl:w,baseCdnUrl:I,innerRef:f,"theme.attr":d,"debug.attr":c,"styleId.attr":m,"logger.prop":t}))}));export{d as default};
1
+ import e,{lazy as t,useState as r,useImperativeHandle as a,Suspense as o}from"react";import n from"../hooks/Context.js";import s from"./withPropsMapping/index.js";const l=t((async()=>(await import("@descope/role-management-widget"),{default:s(e.forwardRef(((t,r)=>e.createElement("descope-role-management-widget",Object.assign({ref:r},t)))))}))),d=e.forwardRef((({logger:t,tenant:s,theme:d,debug:i,widgetId:m,styleId:c},f)=>{const[g,p]=r(null);a(f,(()=>g));const{projectId:b,baseUrl:u,baseStaticUrl:w,baseCdnUrl:h,refreshCookieName:C}=e.useContext(n);return e.createElement(o,{fallback:null},e.createElement(l,{projectId:b,widgetId:m,tenant:s,baseUrl:u,baseStaticUrl:w,baseCdnUrl:h,innerRef:p,"theme.attr":d,"debug.attr":i,"styleId.attr":c,"refreshCookieName.attr":C,"logger.prop":t}))}));export{d as default};
2
2
  //# sourceMappingURL=RoleManagement.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RoleManagement.js","sources":["../../../src/components/RoleManagement.tsx"],"sourcesContent":["import React, { lazy, Suspense, useImperativeHandle, useState } from 'react';\nimport Context from '../hooks/Context';\nimport { RoleManagementProps } from '../types';\nimport withPropsMapping from './withPropsMapping';\n\n// web-component code uses browser API, but can be used in SSR apps, hence the lazy loading\nconst RoleManagementWC = lazy(async () => {\n await import('@descope/role-management-widget');\n\n return {\n default: withPropsMapping(\n React.forwardRef<HTMLElement>((props, ref) => (\n\t<descope-role-management-widget ref={ref} {...props} />\n )),\n ),\n };\n});\n\nconst RoleManagement = React.forwardRef<HTMLElement, RoleManagementProps>(\n ({ logger, tenant, theme, debug, widgetId, styleId }, ref) => {\n const [innerRef, setInnerRef] = useState(null);\n\n useImperativeHandle(ref, () => innerRef);\n\n const { projectId, baseUrl, baseStaticUrl, baseCdnUrl } =\n React.useContext(Context);\n\n return (\n\t<Suspense fallback={null}>\n\t\t<RoleManagementWC\n projectId={projectId}\n widgetId={widgetId}\n tenant={tenant}\n baseUrl={baseUrl}\n baseStaticUrl={baseStaticUrl}\n baseCdnUrl={baseCdnUrl}\n innerRef={setInnerRef}\n {...{\n // attributes\n 'theme.attr': theme,\n 'debug.attr': debug,\n 'styleId.attr': styleId,\n // props\n 'logger.prop': logger,\n }}\n />\n\t</Suspense>\n );\n },\n);\n\nexport default RoleManagement;\n"],"names":["RoleManagementWC","lazy","async","import","default","withPropsMapping","React","forwardRef","props","ref","createElement","Object","assign","RoleManagement","logger","tenant","theme","debug","widgetId","styleId","innerRef","setInnerRef","useState","useImperativeHandle","projectId","baseUrl","baseStaticUrl","baseCdnUrl","useContext","Context","Suspense","fallback"],"mappings":"mKAMA,MAAMA,EAAmBC,GAAKC,gBACtBC,OAAO,mCAEN,CACLC,QAASC,EACPC,EAAMC,YAAwB,CAACC,EAAOC,IAC3CH,EAAgCI,cAAA,iCAAAC,OAAAC,OAAA,CAAAH,IAAKA,GAASD,WAMzCK,EAAiBP,EAAMC,YAC3B,EAAGO,SAAQC,SAAQC,QAAOC,QAAOC,WAAUC,WAAWV,KACpD,MAAOW,EAAUC,GAAeC,EAAS,MAEzCC,EAAoBd,GAAK,IAAMW,IAE/B,MAAMI,UAAEA,EAASC,QAAEA,EAAOC,cAAEA,EAAaC,WAAEA,GACzCrB,EAAMsB,WAAWC,GAEnB,OACHvB,EAACI,cAAAoB,EAAS,CAAAC,SAAU,MACnBzB,EAAAI,cAACV,EAAgB,CACTwB,UAAWA,EACXN,SAAUA,EACVH,OAAQA,EACRU,QAASA,EACTC,cAAeA,EACfC,WAAYA,EACZP,SAAUC,EAGR,aAAcL,EACd,aAAcC,EACd,eAAgBE,EAEhB,cAAeL,IAIrB"}
1
+ {"version":3,"file":"RoleManagement.js","sources":["../../../src/components/RoleManagement.tsx"],"sourcesContent":["import React, { lazy, Suspense, useImperativeHandle, useState } from 'react';\nimport Context from '../hooks/Context';\nimport { RoleManagementProps } from '../types';\nimport withPropsMapping from './withPropsMapping';\n\n// web-component code uses browser API, but can be used in SSR apps, hence the lazy loading\nconst RoleManagementWC = lazy(async () => {\n await import('@descope/role-management-widget');\n\n return {\n default: withPropsMapping(\n React.forwardRef<HTMLElement>((props, ref) => (\n\t<descope-role-management-widget ref={ref} {...props} />\n )),\n ),\n };\n});\n\nconst RoleManagement = React.forwardRef<HTMLElement, RoleManagementProps>(\n ({ logger, tenant, theme, debug, widgetId, styleId }, ref) => {\n const [innerRef, setInnerRef] = useState(null);\n\n useImperativeHandle(ref, () => innerRef);\n\n const { projectId, baseUrl, baseStaticUrl, baseCdnUrl, refreshCookieName } =\n React.useContext(Context);\n\n return (\n\t<Suspense fallback={null}>\n\t\t<RoleManagementWC\n projectId={projectId}\n widgetId={widgetId}\n tenant={tenant}\n baseUrl={baseUrl}\n baseStaticUrl={baseStaticUrl}\n baseCdnUrl={baseCdnUrl}\n innerRef={setInnerRef}\n {...{\n // attributes\n 'theme.attr': theme,\n 'debug.attr': debug,\n 'styleId.attr': styleId,\n 'refreshCookieName.attr': refreshCookieName,\n // props\n 'logger.prop': logger,\n }}\n />\n\t</Suspense>\n );\n },\n);\n\nexport default RoleManagement;\n"],"names":["RoleManagementWC","lazy","async","import","default","withPropsMapping","React","forwardRef","props","ref","createElement","Object","assign","RoleManagement","logger","tenant","theme","debug","widgetId","styleId","innerRef","setInnerRef","useState","useImperativeHandle","projectId","baseUrl","baseStaticUrl","baseCdnUrl","refreshCookieName","useContext","Context","Suspense","fallback"],"mappings":"mKAMA,MAAMA,EAAmBC,GAAKC,gBACtBC,OAAO,mCAEN,CACLC,QAASC,EACPC,EAAMC,YAAwB,CAACC,EAAOC,IAC3CH,EAAgCI,cAAA,iCAAAC,OAAAC,OAAA,CAAAH,IAAKA,GAASD,WAMzCK,EAAiBP,EAAMC,YAC3B,EAAGO,SAAQC,SAAQC,QAAOC,QAAOC,WAAUC,WAAWV,KACpD,MAAOW,EAAUC,GAAeC,EAAS,MAEzCC,EAAoBd,GAAK,IAAMW,IAE/B,MAAMI,UAAEA,EAASC,QAAEA,EAAOC,cAAEA,EAAaC,WAAEA,EAAUC,kBAAEA,GACrDtB,EAAMuB,WAAWC,GAEnB,OACHxB,EAACI,cAAAqB,EAAS,CAAAC,SAAU,MACnB1B,EAAAI,cAACV,EAAgB,CACTwB,UAAWA,EACXN,SAAUA,EACVH,OAAQA,EACRU,QAASA,EACTC,cAAeA,EACfC,WAAYA,EACZP,SAAUC,EAGR,aAAcL,EACd,aAAcC,EACd,eAAgBE,EAChB,yBAA0BS,EAE1B,cAAed,IAIrB"}
@@ -1,2 +1,2 @@
1
- import e,{lazy as t,useState as r,useImperativeHandle as a,Suspense as n}from"react";import o from"../hooks/Context.js";import s from"./withPropsMapping/index.js";const d=t((async()=>(await import("@descope/user-management-widget"),{default:s(e.forwardRef(((t,r)=>e.createElement("descope-user-management-widget",Object.assign({ref:r},t)))))}))),l=e.forwardRef((({logger:t,tenant:s,theme:l,debug:c,widgetId:m,styleId:i},g)=>{const[p,f]=r(null);a(g,(()=>p));const{projectId:b,baseUrl:u,baseStaticUrl:w,baseCdnUrl:I}=e.useContext(o);return e.createElement(n,{fallback:null},e.createElement(d,{projectId:b,widgetId:m,tenant:s,baseUrl:u,baseStaticUrl:w,baseCdnUrl:I,ref:f,"theme.attr":l,"debug.attr":c,"styleId.attr":i,"logger.prop":t}))}));export{l as default};
1
+ import e,{lazy as t,useState as r,useImperativeHandle as a,Suspense as o}from"react";import s from"../hooks/Context.js";import n from"./withPropsMapping/index.js";const d=t((async()=>(await import("@descope/user-management-widget"),{default:n(e.forwardRef(((t,r)=>e.createElement("descope-user-management-widget",Object.assign({ref:r},t)))))}))),l=e.forwardRef((({logger:t,tenant:n,theme:l,debug:m,widgetId:i,styleId:c},f)=>{const[g,p]=r(null);a(f,(()=>g));const{projectId:b,baseUrl:u,baseStaticUrl:w,baseCdnUrl:h,refreshCookieName:C}=e.useContext(s);return e.createElement(o,{fallback:null},e.createElement(d,{projectId:b,widgetId:i,tenant:n,baseUrl:u,baseStaticUrl:w,baseCdnUrl:h,ref:p,"theme.attr":l,"debug.attr":m,"styleId.attr":c,"refreshCookieName.attr":C,"logger.prop":t}))}));export{l as default};
2
2
  //# sourceMappingURL=UserManagement.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UserManagement.js","sources":["../../../src/components/UserManagement.tsx"],"sourcesContent":["import React, { lazy, Suspense, useImperativeHandle, useState } from 'react';\nimport Context from '../hooks/Context';\nimport { UserManagementProps } from '../types';\nimport withPropsMapping from './withPropsMapping';\n\n// web-component code uses browser API, but can be used in SSR apps, hence the lazy loading\nconst UserManagementWC = lazy(async () => {\n await import('@descope/user-management-widget');\n\n return {\n default: withPropsMapping(\n React.forwardRef<HTMLElement>((props, ref) => (\n\t<descope-user-management-widget ref={ref} {...props} />\n )),\n ),\n };\n});\n\nconst UserManagement = React.forwardRef<HTMLElement, UserManagementProps>(\n ({ logger, tenant, theme, debug, widgetId, styleId }, ref) => {\n const [innerRef, setInnerRef] = useState(null);\n\n useImperativeHandle(ref, () => innerRef);\n\n const { projectId, baseUrl, baseStaticUrl, baseCdnUrl } =\n React.useContext(Context);\n\n return (\n\t<Suspense fallback={null}>\n\t\t<UserManagementWC\n projectId={projectId}\n widgetId={widgetId}\n tenant={tenant}\n baseUrl={baseUrl}\n baseStaticUrl={baseStaticUrl}\n baseCdnUrl={baseCdnUrl}\n ref={setInnerRef}\n {...{\n // attributes\n 'theme.attr': theme,\n 'debug.attr': debug,\n 'styleId.attr': styleId,\n // props\n 'logger.prop': logger,\n }}\n />\n\t</Suspense>\n );\n },\n);\n\nexport default UserManagement;\n"],"names":["UserManagementWC","lazy","async","import","default","withPropsMapping","React","forwardRef","props","ref","createElement","Object","assign","UserManagement","logger","tenant","theme","debug","widgetId","styleId","innerRef","setInnerRef","useState","useImperativeHandle","projectId","baseUrl","baseStaticUrl","baseCdnUrl","useContext","Context","Suspense","fallback"],"mappings":"mKAMA,MAAMA,EAAmBC,GAAKC,gBACtBC,OAAO,mCAEN,CACLC,QAASC,EACPC,EAAMC,YAAwB,CAACC,EAAOC,IAC3CH,EAAgCI,cAAA,iCAAAC,OAAAC,OAAA,CAAAH,IAAKA,GAASD,WAMzCK,EAAiBP,EAAMC,YAC3B,EAAGO,SAAQC,SAAQC,QAAOC,QAAOC,WAAUC,WAAWV,KACpD,MAAOW,EAAUC,GAAeC,EAAS,MAEzCC,EAAoBd,GAAK,IAAMW,IAE/B,MAAMI,UAAEA,EAASC,QAAEA,EAAOC,cAAEA,EAAaC,WAAEA,GACzCrB,EAAMsB,WAAWC,GAEnB,OACHvB,EAACI,cAAAoB,EAAS,CAAAC,SAAU,MACnBzB,EAAAI,cAACV,EAAgB,CACTwB,UAAWA,EACXN,SAAUA,EACVH,OAAQA,EACRU,QAASA,EACTC,cAAeA,EACfC,WAAYA,EACZlB,IAAKY,EAGH,aAAcL,EACd,aAAcC,EACd,eAAgBE,EAEhB,cAAeL,IAIrB"}
1
+ {"version":3,"file":"UserManagement.js","sources":["../../../src/components/UserManagement.tsx"],"sourcesContent":["import React, { lazy, Suspense, useImperativeHandle, useState } from 'react';\nimport Context from '../hooks/Context';\nimport { UserManagementProps } from '../types';\nimport withPropsMapping from './withPropsMapping';\n\n// web-component code uses browser API, but can be used in SSR apps, hence the lazy loading\nconst UserManagementWC = lazy(async () => {\n await import('@descope/user-management-widget');\n\n return {\n default: withPropsMapping(\n React.forwardRef<HTMLElement>((props, ref) => (\n\t<descope-user-management-widget ref={ref} {...props} />\n )),\n ),\n };\n});\n\nconst UserManagement = React.forwardRef<HTMLElement, UserManagementProps>(\n ({ logger, tenant, theme, debug, widgetId, styleId }, ref) => {\n const [innerRef, setInnerRef] = useState(null);\n\n useImperativeHandle(ref, () => innerRef);\n\n const { projectId, baseUrl, baseStaticUrl, baseCdnUrl, refreshCookieName } =\n React.useContext(Context);\n\n return (\n\t<Suspense fallback={null}>\n\t\t<UserManagementWC\n projectId={projectId}\n widgetId={widgetId}\n tenant={tenant}\n baseUrl={baseUrl}\n baseStaticUrl={baseStaticUrl}\n baseCdnUrl={baseCdnUrl}\n ref={setInnerRef}\n {...{\n // attributes\n 'theme.attr': theme,\n 'debug.attr': debug,\n 'styleId.attr': styleId,\n 'refreshCookieName.attr': refreshCookieName,\n // props\n 'logger.prop': logger,\n }}\n />\n\t</Suspense>\n );\n },\n);\n\nexport default UserManagement;\n"],"names":["UserManagementWC","lazy","async","import","default","withPropsMapping","React","forwardRef","props","ref","createElement","Object","assign","UserManagement","logger","tenant","theme","debug","widgetId","styleId","innerRef","setInnerRef","useState","useImperativeHandle","projectId","baseUrl","baseStaticUrl","baseCdnUrl","refreshCookieName","useContext","Context","Suspense","fallback"],"mappings":"mKAMA,MAAMA,EAAmBC,GAAKC,gBACtBC,OAAO,mCAEN,CACLC,QAASC,EACPC,EAAMC,YAAwB,CAACC,EAAOC,IAC3CH,EAAgCI,cAAA,iCAAAC,OAAAC,OAAA,CAAAH,IAAKA,GAASD,WAMzCK,EAAiBP,EAAMC,YAC3B,EAAGO,SAAQC,SAAQC,QAAOC,QAAOC,WAAUC,WAAWV,KACpD,MAAOW,EAAUC,GAAeC,EAAS,MAEzCC,EAAoBd,GAAK,IAAMW,IAE/B,MAAMI,UAAEA,EAASC,QAAEA,EAAOC,cAAEA,EAAaC,WAAEA,EAAUC,kBAAEA,GACrDtB,EAAMuB,WAAWC,GAEnB,OACHxB,EAACI,cAAAqB,EAAS,CAAAC,SAAU,MACnB1B,EAAAI,cAACV,EAAgB,CACTwB,UAAWA,EACXN,SAAUA,EACVH,OAAQA,EACRU,QAASA,EACTC,cAAeA,EACfC,WAAYA,EACZlB,IAAKY,EAGH,aAAcL,EACd,aAAcC,EACd,eAAgBE,EAChB,yBAA0BS,EAE1B,cAAed,IAIrB"}
@@ -1,2 +1,2 @@
1
- import e,{lazy as t,useState as r,useImperativeHandle as o,useEffect as a,Suspense as s}from"react";import l from"../hooks/Context.js";import d from"./withPropsMapping/index.js";const n=t((async()=>(await import("@descope/user-profile-widget"),{default:d(e.forwardRef(((t,r)=>e.createElement("descope-user-profile-widget",Object.assign({ref:r},t)))))}))),i=e.forwardRef((({logger:t,theme:d,debug:i,widgetId:c,onLogout:p,styleId:f},g)=>{const[u,m]=r(null);o(g,(()=>u));const{projectId:b,baseUrl:w,baseStaticUrl:I,baseCdnUrl:U}=e.useContext(l);return a((()=>{if(u&&p)return u.addEventListener("logout",p),()=>u.removeEventListener("logout",p)}),[u,p]),e.createElement(s,{fallback:null},e.createElement(n,{projectId:b,widgetId:c,baseUrl:w,baseStaticUrl:I,baseCdnUrl:U,styleId:f,ref:m,"theme.attr":d,"debug.attr":i,"styleId.attr":f,"logger.prop":t}))}));export{i as default};
1
+ import e,{lazy as t,useState as r,useImperativeHandle as o,useEffect as a,Suspense as s}from"react";import l from"../hooks/Context.js";import d from"./withPropsMapping/index.js";const n=t((async()=>(await import("@descope/user-profile-widget"),{default:d(e.forwardRef(((t,r)=>e.createElement("descope-user-profile-widget",Object.assign({ref:r},t)))))}))),i=e.forwardRef((({logger:t,theme:d,debug:i,widgetId:f,onLogout:c,styleId:p},g)=>{const[m,u]=r(null);o(g,(()=>m));const{projectId:b,baseUrl:w,baseStaticUrl:I,baseCdnUrl:h,refreshCookieName:C}=e.useContext(l);return a((()=>{if(m&&c)return m.addEventListener("logout",c),()=>m.removeEventListener("logout",c)}),[m,c]),e.createElement(s,{fallback:null},e.createElement(n,{projectId:b,widgetId:f,baseUrl:w,baseStaticUrl:I,baseCdnUrl:h,styleId:p,ref:u,"theme.attr":d,"debug.attr":i,"styleId.attr":p,"refreshCookieName.attr":C,"logger.prop":t}))}));export{i as default};
2
2
  //# sourceMappingURL=UserProfile.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UserProfile.js","sources":["../../../src/components/UserProfile.tsx"],"sourcesContent":["import React, {\n lazy,\n Suspense,\n useEffect,\n useImperativeHandle,\n useState,\n} from 'react';\nimport Context from '../hooks/Context';\nimport { UserProfileProps } from '../types';\nimport withPropsMapping from './withPropsMapping';\n\n// web-component code uses browser API, but can be used in SSR apps, hence the lazy loading\nconst UserProfileWC = lazy(async () => {\n await import('@descope/user-profile-widget');\n\n return {\n default: withPropsMapping(\n React.forwardRef<HTMLElement>((props, ref) => (\n\t<descope-user-profile-widget ref={ref} {...props} />\n )),\n ),\n };\n});\n\nconst UserProfile = React.forwardRef<HTMLElement, UserProfileProps>(\n ({ logger, theme, debug, widgetId, onLogout, styleId }, ref) => {\n const [innerRef, setInnerRef] = useState(null);\n\n useImperativeHandle(ref, () => innerRef);\n\n const { projectId, baseUrl, baseStaticUrl, baseCdnUrl } =\n React.useContext(Context);\n\n useEffect(() => {\n if (innerRef && onLogout) {\n innerRef.addEventListener('logout', onLogout);\n return () => innerRef.removeEventListener('logout', onLogout);\n }\n return undefined;\n }, [innerRef, onLogout]);\n\n return (\n\t<Suspense fallback={null}>\n\t\t<UserProfileWC\n projectId={projectId}\n widgetId={widgetId}\n baseUrl={baseUrl}\n baseStaticUrl={baseStaticUrl}\n baseCdnUrl={baseCdnUrl}\n styleId={styleId}\n ref={setInnerRef}\n {...{\n // attributes\n 'theme.attr': theme,\n 'debug.attr': debug,\n 'styleId.attr': styleId,\n // props\n 'logger.prop': logger,\n }}\n />\n\t</Suspense>\n );\n },\n);\n\nexport default UserProfile;\n"],"names":["UserProfileWC","lazy","async","import","default","withPropsMapping","React","forwardRef","props","ref","createElement","Object","assign","UserProfile","logger","theme","debug","widgetId","onLogout","styleId","innerRef","setInnerRef","useState","useImperativeHandle","projectId","baseUrl","baseStaticUrl","baseCdnUrl","useContext","Context","useEffect","addEventListener","removeEventListener","Suspense","fallback"],"mappings":"kLAYA,MAAMA,EAAgBC,GAAKC,gBACnBC,OAAO,gCAEN,CACLC,QAASC,EACPC,EAAMC,YAAwB,CAACC,EAAOC,IAC3CH,EAA6BI,cAAA,8BAAAC,OAAAC,OAAA,CAAAH,IAAKA,GAASD,WAMtCK,EAAcP,EAAMC,YACxB,EAAGO,SAAQC,QAAOC,QAAOC,WAAUC,WAAUC,WAAWV,KACtD,MAAOW,EAAUC,GAAeC,EAAS,MAEzCC,EAAoBd,GAAK,IAAMW,IAE/B,MAAMI,UAAEA,EAASC,QAAEA,EAAOC,cAAEA,EAAaC,WAAEA,GACzCrB,EAAMsB,WAAWC,GAUnB,OARAC,GAAU,KACR,GAAIV,GAAYF,EAEd,OADAE,EAASW,iBAAiB,SAAUb,GAC7B,IAAME,EAASY,oBAAoB,SAAUd,EAEtC,GACf,CAACE,EAAUF,IAGjBZ,EAACI,cAAAuB,EAAS,CAAAC,SAAU,MACnB5B,EAAAI,cAACV,EAAa,CACNwB,UAAWA,EACXP,SAAUA,EACVQ,QAASA,EACTC,cAAeA,EACfC,WAAYA,EACZR,QAASA,EACTV,IAAKY,EAGH,aAAcN,EACd,aAAcC,EACd,eAAgBG,EAEhB,cAAeL,IAIrB"}
1
+ {"version":3,"file":"UserProfile.js","sources":["../../../src/components/UserProfile.tsx"],"sourcesContent":["import React, {\n lazy,\n Suspense,\n useEffect,\n useImperativeHandle,\n useState,\n} from 'react';\nimport Context from '../hooks/Context';\nimport { UserProfileProps } from '../types';\nimport withPropsMapping from './withPropsMapping';\n\n// web-component code uses browser API, but can be used in SSR apps, hence the lazy loading\nconst UserProfileWC = lazy(async () => {\n await import('@descope/user-profile-widget');\n\n return {\n default: withPropsMapping(\n React.forwardRef<HTMLElement>((props, ref) => (\n\t<descope-user-profile-widget ref={ref} {...props} />\n )),\n ),\n };\n});\n\nconst UserProfile = React.forwardRef<HTMLElement, UserProfileProps>(\n ({ logger, theme, debug, widgetId, onLogout, styleId }, ref) => {\n const [innerRef, setInnerRef] = useState(null);\n\n useImperativeHandle(ref, () => innerRef);\n\n const { projectId, baseUrl, baseStaticUrl, baseCdnUrl, refreshCookieName } =\n React.useContext(Context);\n\n useEffect(() => {\n if (innerRef && onLogout) {\n innerRef.addEventListener('logout', onLogout);\n return () => innerRef.removeEventListener('logout', onLogout);\n }\n return undefined;\n }, [innerRef, onLogout]);\n\n return (\n\t<Suspense fallback={null}>\n\t\t<UserProfileWC\n projectId={projectId}\n widgetId={widgetId}\n baseUrl={baseUrl}\n baseStaticUrl={baseStaticUrl}\n baseCdnUrl={baseCdnUrl}\n styleId={styleId}\n ref={setInnerRef}\n {...{\n // attributes\n 'theme.attr': theme,\n 'debug.attr': debug,\n 'styleId.attr': styleId,\n 'refreshCookieName.attr': refreshCookieName,\n // props\n 'logger.prop': logger,\n }}\n />\n\t</Suspense>\n );\n },\n);\n\nexport default UserProfile;\n"],"names":["UserProfileWC","lazy","async","import","default","withPropsMapping","React","forwardRef","props","ref","createElement","Object","assign","UserProfile","logger","theme","debug","widgetId","onLogout","styleId","innerRef","setInnerRef","useState","useImperativeHandle","projectId","baseUrl","baseStaticUrl","baseCdnUrl","refreshCookieName","useContext","Context","useEffect","addEventListener","removeEventListener","Suspense","fallback"],"mappings":"kLAYA,MAAMA,EAAgBC,GAAKC,gBACnBC,OAAO,gCAEN,CACLC,QAASC,EACPC,EAAMC,YAAwB,CAACC,EAAOC,IAC3CH,EAA6BI,cAAA,8BAAAC,OAAAC,OAAA,CAAAH,IAAKA,GAASD,WAMtCK,EAAcP,EAAMC,YACxB,EAAGO,SAAQC,QAAOC,QAAOC,WAAUC,WAAUC,WAAWV,KACtD,MAAOW,EAAUC,GAAeC,EAAS,MAEzCC,EAAoBd,GAAK,IAAMW,IAE/B,MAAMI,UAAEA,EAASC,QAAEA,EAAOC,cAAEA,EAAaC,WAAEA,EAAUC,kBAAEA,GACrDtB,EAAMuB,WAAWC,GAUnB,OARAC,GAAU,KACR,GAAIX,GAAYF,EAEd,OADAE,EAASY,iBAAiB,SAAUd,GAC7B,IAAME,EAASa,oBAAoB,SAAUf,EAEtC,GACf,CAACE,EAAUF,IAGjBZ,EAACI,cAAAwB,EAAS,CAAAC,SAAU,MACnB7B,EAAAI,cAACV,EAAa,CACNwB,UAAWA,EACXP,SAAUA,EACVQ,QAASA,EACTC,cAAeA,EACfC,WAAYA,EACZR,QAASA,EACTV,IAAKY,EAGH,aAAcN,EACd,aAAcC,EACd,eAAgBG,EAChB,yBAA0BS,EAE1B,cAAed,IAIrB"}
@@ -1,2 +1,2 @@
1
- const e={"x-descope-sdk-name":"react","x-descope-sdk-version":"2.6.0"},d="undefined"!=typeof window;export{d as IS_BROWSER,e as baseHeaders};
1
+ const e={"x-descope-sdk-name":"react","x-descope-sdk-version":"2.7.0"},d="undefined"!=typeof window;export{d as IS_BROWSER,e as baseHeaders};
2
2
  //# sourceMappingURL=constants.js.map
package/dist/index.d.ts CHANGED
@@ -22,6 +22,7 @@ interface IAuthProviderProps {
22
22
  };
23
23
  storeLastAuthenticatedUser?: boolean;
24
24
  keepLastAuthenticatedUserAfterLogout?: boolean;
25
+ refreshCookieName?: string;
25
26
  children?: React.ReactNode;
26
27
  }
27
28
  declare const AuthProvider: FC<IAuthProviderProps>;
@@ -54,6 +55,7 @@ declare const createSdkWrapper: <P extends Omit<{
54
55
  };
55
56
  cookiePolicy?: RequestCredentials;
56
57
  baseHeaders?: HeadersInit;
58
+ refreshCookieName?: string;
57
59
  fetch?: typeof fetch;
58
60
  }, "hooks"> & {
59
61
  hooks?: {
@@ -538,7 +540,7 @@ declare const createSdkWrapper: <P extends Omit<{
538
540
  finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_1.SdkResponse<_1.ResponseData>>;
539
541
  };
540
542
  saml: {
541
- start: (tenantIdOrEmail: string, redirectUrl?: string, loginOptions?: _1.LoginOptions, token?: string) => Promise<_1.SdkResponse<_1.URLResponse>>;
543
+ start: (tenantIdOrEmail: string, redirectUrl?: string, loginOptions?: _1.LoginOptions, token?: string, ssoId?: string) => Promise<_1.SdkResponse<_1.URLResponse>>;
542
544
  exchange: (code: string) => Promise<_1.SdkResponse<_1.JWTResponse>>;
543
545
  };
544
546
  totp: {
@@ -1148,7 +1150,7 @@ declare const createSdkWrapper: <P extends Omit<{
1148
1150
  finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_1.SdkResponse<_1.ResponseData>>;
1149
1151
  };
1150
1152
  saml: {
1151
- start: (tenantIdOrEmail: string, redirectUrl?: string, loginOptions?: _1.LoginOptions, token?: string) => Promise<_1.SdkResponse<_1.URLResponse>>;
1153
+ start: (tenantIdOrEmail: string, redirectUrl?: string, loginOptions?: _1.LoginOptions, token?: string, ssoId?: string) => Promise<_1.SdkResponse<_1.URLResponse>>;
1152
1154
  exchange: (code: string) => Promise<_1.SdkResponse<_1.JWTResponse>>;
1153
1155
  };
1154
1156
  totp: {
@@ -1316,7 +1318,7 @@ declare const getJwtPermissions: (token?: any, tenant?: string) => string[];
1316
1318
  declare const getJwtRoles: (token?: any, tenant?: string) => string[];
1317
1319
  declare const refresh: (token?: string) => Promise<_1.SdkResponse<_1.JWTResponse>>;
1318
1320
 
1319
- declare module 'react' {
1321
+ declare global {
1320
1322
  namespace JSX {
1321
1323
  interface IntrinsicElements {
1322
1324
  ['descope-wc']: DescopeCustomElement;