@asgardeo/react 0.5.15 → 0.5.16

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.
@@ -16,7 +16,7 @@
16
16
  * under the License.
17
17
  */
18
18
  import { Context } from 'react';
19
- import { HttpRequestConfig, HttpResponse, Organization, SignInOptions } from '@asgardeo/browser';
19
+ import { HttpRequestConfig, HttpResponse, IdToken, Organization, SignInOptions } from '@asgardeo/browser';
20
20
  import AsgardeoReactClient from '../../AsgardeoReactClient';
21
21
  /**
22
22
  * Props interface of {@link AsgardeoContext}
@@ -87,6 +87,14 @@ export type AsgardeoContextProps = {
87
87
  * signInOptions: { prompt: "login", fidp: "OrganizationSSO" }
88
88
  */
89
89
  signInOptions?: SignInOptions;
90
+ /**
91
+ * Function to retrieve the decoded ID token.
92
+ * This function decodes the ID token and returns its payload.
93
+ * It can be used to access user claims and other information contained in the ID token.
94
+ *
95
+ * @returns A promise that resolves to the decoded ID token payload.
96
+ */
97
+ getDecodedIdToken?: () => Promise<IdToken>;
90
98
  };
91
99
  /**
92
100
  * Context object for managing the Authentication flow builder core context.
package/dist/index.js CHANGED
@@ -32,7 +32,8 @@ var AsgardeoContext = createContext({
32
32
  request: () => null,
33
33
  requestAll: () => null
34
34
  },
35
- signInOptions: {}
35
+ signInOptions: {},
36
+ getDecodedIdToken: null
36
37
  });
37
38
  AsgardeoContext.displayName = "AsgardeoContext";
38
39
  var AsgardeoContext_default = AsgardeoContext;
@@ -1372,6 +1373,7 @@ var AsgardeoProvider = ({
1372
1373
  organizationHandle,
1373
1374
  applicationId,
1374
1375
  signInOptions,
1376
+ syncSession,
1375
1377
  ...rest
1376
1378
  }) => {
1377
1379
  const reRenderCheckRef = useRef(false);
@@ -1396,6 +1398,7 @@ var AsgardeoProvider = ({
1396
1398
  signUpUrl,
1397
1399
  signInUrl,
1398
1400
  signInOptions,
1401
+ syncSession,
1399
1402
  ...rest
1400
1403
  });
1401
1404
  const [brandingPreference, setBrandingPreference] = useState7(null);
@@ -1634,7 +1637,9 @@ var AsgardeoProvider = ({
1634
1637
  request: asgardeo.request.bind(asgardeo),
1635
1638
  requestAll: asgardeo.requestAll.bind(asgardeo)
1636
1639
  },
1637
- signInOptions
1640
+ signInOptions,
1641
+ getDecodedIdToken: asgardeo.getDecodedIdToken.bind(asgardeo),
1642
+ syncSession
1638
1643
  }),
1639
1644
  [
1640
1645
  applicationId,
@@ -1651,7 +1656,8 @@ var AsgardeoProvider = ({
1651
1656
  signInSilently,
1652
1657
  user,
1653
1658
  asgardeo,
1654
- signInOptions
1659
+ signInOptions,
1660
+ syncSession
1655
1661
  ]
1656
1662
  );
1657
1663
  return /* @__PURE__ */ jsx7(AsgardeoContext_default.Provider, { value, children: /* @__PURE__ */ jsx7(I18nProvider_default, { preferences: preferences?.i18n, children: /* @__PURE__ */ jsx7(