@swype-org/react-sdk 0.1.267 → 0.1.268

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.cjs CHANGED
@@ -8707,7 +8707,6 @@ function useMobilePollingEffect(deps) {
8707
8707
  const finishMobileAndDispatch = async () => {
8708
8708
  mobileSetupFlowRef.current = false;
8709
8709
  setupAccountIdRef.current = null;
8710
- clearMobileFlowState();
8711
8710
  try {
8712
8711
  await reloadAccounts();
8713
8712
  } catch {
@@ -8718,6 +8717,7 @@ function useMobilePollingEffect(deps) {
8718
8717
  completedGuestPreauth = true;
8719
8718
  cancelled = true;
8720
8719
  await finishMobileAndDispatch();
8720
+ clearMobileFlowState();
8721
8721
  dispatch({ type: "MOBILE_SETUP_COMPLETE" });
8722
8722
  };
8723
8723
  const completeGuestPreauthWithAccount = async (guestLookup) => {
@@ -8745,6 +8745,18 @@ function useMobilePollingEffect(deps) {
8745
8745
  const guestLookup = await fetchGuestAccount(apiBaseUrl, guestToken);
8746
8746
  if (cancelled) return;
8747
8747
  if (guestLookup != null) {
8748
+ if (preauthSessionId) {
8749
+ try {
8750
+ const session = await fetchAuthorizationSession(
8751
+ apiBaseUrl,
8752
+ preauthSessionId
8753
+ );
8754
+ if (cancelled) return;
8755
+ if (session.status !== "AUTHORIZED") return;
8756
+ } catch {
8757
+ return;
8758
+ }
8759
+ }
8748
8760
  await completeGuestPreauthWithAccount(guestLookup);
8749
8761
  }
8750
8762
  } catch {
@@ -8958,6 +8970,18 @@ function useGuestPreauthMobileRestoreEffect(deps) {
8958
8970
  const guestLookup = await fetchGuestAccount(apiBaseUrl, guestToken);
8959
8971
  if (cancelled) return;
8960
8972
  if (guestLookup != null) {
8973
+ if (persisted.sessionId) {
8974
+ try {
8975
+ const session = await fetchAuthorizationSession(
8976
+ apiBaseUrl,
8977
+ persisted.sessionId
8978
+ );
8979
+ if (cancelled) return;
8980
+ if (session.status !== "AUTHORIZED") return;
8981
+ } catch {
8982
+ return;
8983
+ }
8984
+ }
8961
8985
  await handleAccountFound(guestLookup);
8962
8986
  }
8963
8987
  } catch {