@asgardeo/react 0.9.0 → 0.9.1

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/index.js CHANGED
@@ -789,8 +789,15 @@ var AsgardeoReactClient = class extends AsgardeoBrowserClient {
789
789
  const firstArg = args[0];
790
790
  const baseUrl = config?.baseUrl;
791
791
  if (config.platform === Platform.AsgardeoV2) {
792
+ const authIdFromUrl = new URL(window.location.href).searchParams.get("authId");
793
+ const authIdFromStorage = sessionStorage.getItem("asgardeo_auth_id");
794
+ const authId = authIdFromUrl || authIdFromStorage;
795
+ if (authIdFromUrl && !authIdFromStorage) {
796
+ sessionStorage.setItem("asgardeo_auth_id", authIdFromUrl);
797
+ }
792
798
  return executeEmbeddedSignUpFlowV2({
793
799
  baseUrl,
800
+ authId,
794
801
  payload: typeof firstArg === "object" && "flowType" in firstArg ? { ...firstArg, verbose: true } : firstArg
795
802
  });
796
803
  }
@@ -10030,6 +10037,11 @@ var SignUp2 = ({
10030
10037
  const handleOnSubmit = async (payload) => await signUp(payload);
10031
10038
  const handleComplete = (response) => {
10032
10039
  onComplete?.(response);
10040
+ const oauthRedirectUrl = response?.redirectUrl;
10041
+ if (shouldRedirectAfterSignUp && oauthRedirectUrl) {
10042
+ window.location.href = oauthRedirectUrl;
10043
+ return;
10044
+ }
10033
10045
  if (shouldRedirectAfterSignUp && response?.type !== EmbeddedFlowResponseType4.Redirection && afterSignUpUrl) {
10034
10046
  window.location.href = afterSignUpUrl;
10035
10047
  }