@asgardeo/react 0.5.14 → 0.5.15

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/cjs/index.js CHANGED
@@ -176,7 +176,8 @@ var AsgardeoContext = (0, import_react.createContext)({
176
176
  http: {
177
177
  request: () => null,
178
178
  requestAll: () => null
179
- }
179
+ },
180
+ signInOptions: {}
180
181
  });
181
182
  AsgardeoContext.displayName = "AsgardeoContext";
182
183
  var AsgardeoContext_default = AsgardeoContext;
@@ -1483,6 +1484,7 @@ var AsgardeoProvider = ({
1483
1484
  signUpUrl,
1484
1485
  organizationHandle,
1485
1486
  applicationId,
1487
+ signInOptions,
1486
1488
  ...rest
1487
1489
  }) => {
1488
1490
  const reRenderCheckRef = (0, import_react15.useRef)(false);
@@ -1506,6 +1508,7 @@ var AsgardeoProvider = ({
1506
1508
  scopes,
1507
1509
  signUpUrl,
1508
1510
  signInUrl,
1511
+ signInOptions,
1509
1512
  ...rest
1510
1513
  });
1511
1514
  const [brandingPreference, setBrandingPreference] = (0, import_react15.useState)(null);
@@ -1743,7 +1746,8 @@ var AsgardeoProvider = ({
1743
1746
  http: {
1744
1747
  request: asgardeo.request.bind(asgardeo),
1745
1748
  requestAll: asgardeo.requestAll.bind(asgardeo)
1746
- }
1749
+ },
1750
+ signInOptions
1747
1751
  }),
1748
1752
  [
1749
1753
  applicationId,
@@ -1759,7 +1763,8 @@ var AsgardeoProvider = ({
1759
1763
  signIn,
1760
1764
  signInSilently,
1761
1765
  user,
1762
- asgardeo
1766
+ asgardeo,
1767
+ signInOptions
1763
1768
  ]
1764
1769
  );
1765
1770
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(AsgardeoContext_default.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(I18nProvider_default, { preferences: preferences?.i18n, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
@@ -2568,8 +2573,8 @@ var BaseSignInButton_default = BaseSignInButton;
2568
2573
  var import_browser18 = require("@asgardeo/browser");
2569
2574
  var import_react28 = require("react");
2570
2575
  var import_jsx_runtime11 = require("react/jsx-runtime");
2571
- var SignInButton = (0, import_react28.forwardRef)(({ children, onClick, preferences, ...rest }, ref) => {
2572
- const { signIn, signInUrl } = useAsgardeo_default();
2576
+ var SignInButton = (0, import_react28.forwardRef)(({ children, onClick, preferences, signInOptions: overriddenSignInOptions = {}, ...rest }, ref) => {
2577
+ const { signIn, signInUrl, signInOptions } = useAsgardeo_default();
2573
2578
  const { t } = useTranslation_default(preferences?.i18n);
2574
2579
  const [isLoading, setIsLoading] = (0, import_react28.useState)(false);
2575
2580
  const handleSignIn = async (e) => {
@@ -2579,7 +2584,7 @@ var SignInButton = (0, import_react28.forwardRef)(({ children, onClick, preferen
2579
2584
  window.history.pushState(null, "", signInUrl);
2580
2585
  window.dispatchEvent(new PopStateEvent("popstate", { state: null }));
2581
2586
  } else {
2582
- await signIn();
2587
+ await signIn(overriddenSignInOptions ?? signInOptions);
2583
2588
  }
2584
2589
  if (onClick) {
2585
2590
  onClick(e);