@swype-org/react-sdk 0.1.329 → 0.1.339
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 +160 -46
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -4
- package/dist/index.d.ts +23 -4
- package/dist/index.js +160 -47
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1951,7 +1951,7 @@ function resolvePhase(state) {
|
|
|
1951
1951
|
const isFundingSourceSubflow = !state.loginRequested && (currentPhase.step === "token-picker" || currentPhase.step === "one-tap-setup" || currentPhase.step === "select-source" || currentPhase.step === "confirm-sign" || currentPhase.step === "guest-token-picker" && guestTokenPickerEligible);
|
|
1952
1952
|
const walletPickerSwitchEligible = currentPhase.step === "wallet-picker" && currentPhase.reason === "switch" && !state.creatingTransfer && !(state.mobileFlow && state.deeplinkUri);
|
|
1953
1953
|
const missingActivePasskeyCredential = state.passkeyConfigLoaded && !state.activeCredentialId;
|
|
1954
|
-
const shouldPromptPasskeyVerification = missingActivePasskeyCredential && state.knownCredentialIds.length > 0
|
|
1954
|
+
const shouldPromptPasskeyVerification = missingActivePasskeyCredential && state.knownCredentialIds.length > 0;
|
|
1955
1955
|
const guestPreauthClaimPending = state.guestPreauthAccountId != null && state.guestSessionToken != null && state.privyAuthenticated && state.activeCredentialId != null && !state.guestPreauthSetupCompletePending && !state.error;
|
|
1956
1956
|
const branchGuestSetupComplete = state.guestPreauthSetupCompletePending && state.privyReady && state.privyAuthenticated;
|
|
1957
1957
|
const branchKeepGuestPreauthPin = !branchGuestSetupComplete && guestPreauthPinsCurrentPhase;
|
|
@@ -3760,16 +3760,33 @@ function PasskeyScreen({
|
|
|
3760
3760
|
creating,
|
|
3761
3761
|
error,
|
|
3762
3762
|
popupFallback = false,
|
|
3763
|
-
onCreatePasskeyViaPopup
|
|
3763
|
+
onCreatePasskeyViaPopup,
|
|
3764
|
+
onCreateNewPasskey,
|
|
3765
|
+
onCreateNewPasskeyViaPopup,
|
|
3766
|
+
createNewPopupFallback,
|
|
3767
|
+
creatingNewPasskey
|
|
3764
3768
|
}) {
|
|
3765
3769
|
const { tokens } = useBlinkConfig();
|
|
3766
3770
|
const handleCreate = popupFallback && onCreatePasskeyViaPopup ? onCreatePasskeyViaPopup : onCreatePasskey;
|
|
3767
3771
|
const buttonLabel = popupFallback ? "Open Passkey Window" : "Verify Passkey";
|
|
3772
|
+
const showCreateNewLink = onCreateNewPasskey != null;
|
|
3773
|
+
const usePopupForNew = createNewPopupFallback ?? popupFallback;
|
|
3774
|
+
const handleCreateNew = usePopupForNew && onCreateNewPasskeyViaPopup ? onCreateNewPasskeyViaPopup : onCreateNewPasskey;
|
|
3768
3775
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3769
3776
|
ScreenLayout,
|
|
3770
3777
|
{
|
|
3771
3778
|
footer: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3772
|
-
/* @__PURE__ */ jsxRuntime.jsx(PrimaryButton, { onClick: handleCreate, disabled: creating, loading: creating, children: buttonLabel }),
|
|
3779
|
+
/* @__PURE__ */ jsxRuntime.jsx(PrimaryButton, { onClick: handleCreate, disabled: creating || creatingNewPasskey, loading: creating, children: buttonLabel }),
|
|
3780
|
+
showCreateNewLink && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3781
|
+
"button",
|
|
3782
|
+
{
|
|
3783
|
+
type: "button",
|
|
3784
|
+
onClick: handleCreateNew,
|
|
3785
|
+
disabled: creatingNewPasskey || creating,
|
|
3786
|
+
style: createNewLinkStyle(tokens.textMuted),
|
|
3787
|
+
children: creatingNewPasskey ? "Creating passkey\u2026" : "Create a new passkey for this device"
|
|
3788
|
+
}
|
|
3789
|
+
),
|
|
3773
3790
|
/* @__PURE__ */ jsxRuntime.jsx(PoweredByFooter, {})
|
|
3774
3791
|
] }),
|
|
3775
3792
|
children: [
|
|
@@ -3804,6 +3821,17 @@ var subtitleStyle3 = (color) => ({
|
|
|
3804
3821
|
margin: "0 0 20px",
|
|
3805
3822
|
lineHeight: 1.5
|
|
3806
3823
|
});
|
|
3824
|
+
var createNewLinkStyle = (color) => ({
|
|
3825
|
+
background: "none",
|
|
3826
|
+
border: "none",
|
|
3827
|
+
color,
|
|
3828
|
+
fontSize: "0.85rem",
|
|
3829
|
+
cursor: "pointer",
|
|
3830
|
+
padding: "8px 16px",
|
|
3831
|
+
textDecoration: "underline",
|
|
3832
|
+
fontFamily: "inherit",
|
|
3833
|
+
width: "100%"
|
|
3834
|
+
});
|
|
3807
3835
|
var errorBannerStyle2 = (tokens) => ({
|
|
3808
3836
|
background: tokens.errorBg,
|
|
3809
3837
|
border: `1px solid ${tokens.error}66`,
|
|
@@ -4017,7 +4045,7 @@ function WalletPickerScreen({
|
|
|
4017
4045
|
},
|
|
4018
4046
|
loading: connecting || preparing,
|
|
4019
4047
|
disabled: preparing,
|
|
4020
|
-
children: preparing ? "Preparing..." : `Open ${selectedProvider.name} to
|
|
4048
|
+
children: preparing ? "Preparing..." : `Open ${selectedProvider.name} to Deposit`
|
|
4021
4049
|
}
|
|
4022
4050
|
),
|
|
4023
4051
|
/* @__PURE__ */ jsxRuntime.jsx(PoweredByFooter, {})
|
|
@@ -4891,8 +4919,7 @@ function isPreciseMoneyNonPositive(fee) {
|
|
|
4891
4919
|
return Number.isFinite(n) && n <= 0;
|
|
4892
4920
|
}
|
|
4893
4921
|
function formatNonPositiveFeeDisplay(fee) {
|
|
4894
|
-
|
|
4895
|
-
return `Less than 0.01 ${fee.currency}`;
|
|
4922
|
+
return "< $0.01";
|
|
4896
4923
|
}
|
|
4897
4924
|
function formatPreciseMoneyForDisplay(fee) {
|
|
4898
4925
|
const raw = fee.value.trim();
|
|
@@ -4987,13 +5014,14 @@ function DepositScreen({
|
|
|
4987
5014
|
const selectedProviderLogo = KNOWN_LOGOS[selectedProviderName.toLowerCase()];
|
|
4988
5015
|
const totalAccountBalance = selectedAccount ? selectedAccount.wallets.reduce((sum, w) => sum + w.balance.available.amount, 0) : availableBalance;
|
|
4989
5016
|
const isLowBalance = availableBalance < minDepositFloor;
|
|
5017
|
+
const insufficientFunds = availableBalance < amount;
|
|
4990
5018
|
const exceedsLimit = remainingLimit != null && amount > remainingLimit && !isLowBalance;
|
|
4991
|
-
const canDeposit = amount >= minDepositFloor && !exceedsLimit && !isLowBalance && !processing;
|
|
5019
|
+
const canDeposit = amount >= minDepositFloor && !exceedsLimit && !isLowBalance && !insufficientFunds && !processing;
|
|
4992
5020
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4993
5021
|
ScreenLayout,
|
|
4994
5022
|
{
|
|
4995
5023
|
footer: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4996
|
-
!accountPickerOpen && !tokenPickerOpen && (exceedsLimit && onIncreaseLimit ? /* @__PURE__ */ jsxRuntime.jsx(PrimaryButton, { onClick: onIncreaseLimit, loading: increasingLimit, children: "Increase limit" }) : /* @__PURE__ */ jsxRuntime.jsx(PrimaryButton, { onClick: () => onDeposit(amount), disabled: !canDeposit, loading: processing, children: "Confirm" })),
|
|
5024
|
+
!accountPickerOpen && !tokenPickerOpen && (exceedsLimit && onIncreaseLimit ? /* @__PURE__ */ jsxRuntime.jsx(PrimaryButton, { onClick: onIncreaseLimit, loading: increasingLimit, children: "Increase limit" }) : /* @__PURE__ */ jsxRuntime.jsx(PrimaryButton, { onClick: () => onDeposit(amount), disabled: !canDeposit, loading: processing, children: insufficientFunds ? "Insufficient Funds" : "Confirm" })),
|
|
4997
5025
|
/* @__PURE__ */ jsxRuntime.jsx(PoweredByFooter, {})
|
|
4998
5026
|
] }),
|
|
4999
5027
|
children: [
|
|
@@ -5073,7 +5101,7 @@ function DepositScreen({
|
|
|
5073
5101
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: feeRowContainerStyle, "aria-live": "polite", children: /* @__PURE__ */ jsxRuntime.jsx("span", { style: feeRowLabelStyle(tokens.textMuted), children: "Getting fee estimate\u2026" }) });
|
|
5074
5102
|
}
|
|
5075
5103
|
if (quoteFee) {
|
|
5076
|
-
const feeText = isPreciseMoneyNonPositive(quoteFee) ? formatNonPositiveFeeDisplay(
|
|
5104
|
+
const feeText = isPreciseMoneyNonPositive(quoteFee) ? formatNonPositiveFeeDisplay() : formatPreciseMoneyForDisplay(quoteFee);
|
|
5077
5105
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: feeRowContainerStyle, "aria-live": "polite", children: [
|
|
5078
5106
|
/* @__PURE__ */ jsxRuntime.jsx("span", { style: feeRowLabelStyle(tokens.textMuted), children: "Fee estimate: " }),
|
|
5079
5107
|
/* @__PURE__ */ jsxRuntime.jsx("span", { style: feeRowAmountStyle(tokens.textSecondary), children: feeText })
|
|
@@ -5514,6 +5542,25 @@ var feeRowAmountStyle = (color) => ({
|
|
|
5514
5542
|
color,
|
|
5515
5543
|
fontVariantNumeric: "tabular-nums"
|
|
5516
5544
|
});
|
|
5545
|
+
|
|
5546
|
+
// src/deviceBiometricUnlockText.ts
|
|
5547
|
+
var FALLBACK = "Biometric verification";
|
|
5548
|
+
function getDeviceBiometricUnlockText() {
|
|
5549
|
+
const ua = typeof navigator !== "undefined" && typeof navigator.userAgent === "string" ? navigator.userAgent : "";
|
|
5550
|
+
if (/iPhone|iPad|iPod/i.test(ua)) {
|
|
5551
|
+
return "Face ID or Touch ID";
|
|
5552
|
+
}
|
|
5553
|
+
if (/Android/i.test(ua)) {
|
|
5554
|
+
return "Fingerprint or face unlock";
|
|
5555
|
+
}
|
|
5556
|
+
if (/Windows NT/i.test(ua)) {
|
|
5557
|
+
return "Windows Hello";
|
|
5558
|
+
}
|
|
5559
|
+
if (/Macintosh|Mac OS X/i.test(ua)) {
|
|
5560
|
+
return "Touch ID";
|
|
5561
|
+
}
|
|
5562
|
+
return FALLBACK;
|
|
5563
|
+
}
|
|
5517
5564
|
function SuccessScreen({
|
|
5518
5565
|
amount,
|
|
5519
5566
|
currency: _currency,
|
|
@@ -5535,9 +5582,9 @@ function SuccessScreen({
|
|
|
5535
5582
|
{
|
|
5536
5583
|
footer: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5537
5584
|
isGuestDepositSuccess ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5538
|
-
/* @__PURE__ */ jsxRuntime.jsx(PrimaryButton, { onClick: onPreauthorize, children: "
|
|
5539
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: onDone, style: skipButtonStyle(tokens.textMuted), children: "Return to app" })
|
|
5540
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx(PrimaryButton, { onClick: onDone, children: succeeded ? "Done" : "Try again" }),
|
|
5585
|
+
/* @__PURE__ */ jsxRuntime.jsx(PrimaryButton, { onClick: onPreauthorize, children: "Setup" }),
|
|
5586
|
+
onDone && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: onDone, style: skipButtonStyle(tokens.textMuted), children: "Return to app" })
|
|
5587
|
+
] }) : onDone ? /* @__PURE__ */ jsxRuntime.jsx(PrimaryButton, { onClick: onDone, children: succeeded ? "Done" : "Try again" }) : null,
|
|
5541
5588
|
onManageAccount && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: onManageAccount, style: manageStyle(tokens.textMuted), children: "Manage Blink account \u2192" }),
|
|
5542
5589
|
/* @__PURE__ */ jsxRuntime.jsx(PoweredByFooter, {})
|
|
5543
5590
|
] }),
|
|
@@ -5545,13 +5592,17 @@ function SuccessScreen({
|
|
|
5545
5592
|
/* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onLogout }),
|
|
5546
5593
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: screenContentStyle, children: [
|
|
5547
5594
|
isGuestDepositSuccess ? /* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyleCompact, children: [
|
|
5548
|
-
/* @__PURE__ */ jsxRuntime.
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
"
|
|
5595
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle7(tokens.text), children: "Success" }),
|
|
5596
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { style: headingStyle7(tokens.text), children: [
|
|
5597
|
+
"Make next time ",
|
|
5598
|
+
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
5599
|
+
" faster \u2014 and free"
|
|
5552
5600
|
] }),
|
|
5553
|
-
/* @__PURE__ */ jsxRuntime.
|
|
5554
|
-
|
|
5601
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { style: subtitleStyle7(tokens.textSecondary), children: [
|
|
5602
|
+
"Future deposits are just ",
|
|
5603
|
+
getDeviceBiometricUnlockText(),
|
|
5604
|
+
" and go."
|
|
5605
|
+
] })
|
|
5555
5606
|
] }) : succeeded ? /* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyleCompact, children: [
|
|
5556
5607
|
/* @__PURE__ */ jsxRuntime.jsxs("h2", { style: headingStyle7(tokens.text), children: [
|
|
5557
5608
|
"$",
|
|
@@ -6711,7 +6762,7 @@ function GuestTokenPickerScreen({
|
|
|
6711
6762
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: feeRowContainerStyle2, "aria-live": "polite", children: /* @__PURE__ */ jsxRuntime.jsx("span", { style: feeRowLabelStyle2(t.textMuted), children: "Getting fee estimate\u2026" }) });
|
|
6712
6763
|
}
|
|
6713
6764
|
if (quoteFee) {
|
|
6714
|
-
const feeText = isPreciseMoneyNonPositive(quoteFee) ? formatNonPositiveFeeDisplay(
|
|
6765
|
+
const feeText = isPreciseMoneyNonPositive(quoteFee) ? formatNonPositiveFeeDisplay() : formatPreciseMoneyForDisplay(quoteFee);
|
|
6715
6766
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: feeRowContainerStyle2, "aria-live": "polite", children: [
|
|
6716
6767
|
/* @__PURE__ */ jsxRuntime.jsx("span", { style: feeRowLabelStyle2(t.textMuted), children: "Fee estimate: " }),
|
|
6717
6768
|
/* @__PURE__ */ jsxRuntime.jsx("span", { style: feeRowAmountStyle2(t.textSecondary), children: feeText })
|
|
@@ -7311,13 +7362,15 @@ function StepRendererContent({
|
|
|
7311
7362
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7312
7363
|
PasskeyScreen,
|
|
7313
7364
|
{
|
|
7314
|
-
onCreatePasskey: handlers.
|
|
7365
|
+
onCreatePasskey: handlers.onVerifyPasskey,
|
|
7315
7366
|
onBack: handlers.onLogout,
|
|
7316
7367
|
onLogout: handlers.onLogout,
|
|
7317
|
-
creating: state.
|
|
7368
|
+
creating: state.registeringPasskey,
|
|
7318
7369
|
error: state.error,
|
|
7319
|
-
|
|
7320
|
-
|
|
7370
|
+
onCreateNewPasskey: handlers.onCreateNewPasskey,
|
|
7371
|
+
onCreateNewPasskeyViaPopup: handlers.onCreateNewPasskeyViaPopup,
|
|
7372
|
+
createNewPopupFallback: state.passkeyPopupNeeded,
|
|
7373
|
+
creatingNewPasskey: state.registeringPasskey
|
|
7321
7374
|
}
|
|
7322
7375
|
);
|
|
7323
7376
|
case "wallet-picker": {
|
|
@@ -7867,6 +7920,53 @@ function usePasskeyHandlers(dispatch, apiBaseUrl, accounts, knownCredentialIds)
|
|
|
7867
7920
|
dispatch({ type: "SET_REGISTERING_PASSKEY", value: false });
|
|
7868
7921
|
}
|
|
7869
7922
|
}, [user, knownCredentialIds, activateExistingCredential, completePasskeyRegistration, dispatch]);
|
|
7923
|
+
const handleVerifyPasskey = react.useCallback(async () => {
|
|
7924
|
+
dispatch({ type: "SET_REGISTERING_PASSKEY", value: true });
|
|
7925
|
+
dispatch({ type: "SET_ERROR", error: null });
|
|
7926
|
+
try {
|
|
7927
|
+
const matched = await findDevicePasskey(knownCredentialIds);
|
|
7928
|
+
if (matched) {
|
|
7929
|
+
await activateExistingCredential(matched);
|
|
7930
|
+
} else {
|
|
7931
|
+
dispatch({
|
|
7932
|
+
type: "SET_ERROR",
|
|
7933
|
+
error: "No matching passkey found on this device. Please try again."
|
|
7934
|
+
});
|
|
7935
|
+
}
|
|
7936
|
+
} catch (err) {
|
|
7937
|
+
captureException(err);
|
|
7938
|
+
dispatch({
|
|
7939
|
+
type: "SET_ERROR",
|
|
7940
|
+
error: err instanceof Error ? err.message : "Passkey verification failed."
|
|
7941
|
+
});
|
|
7942
|
+
} finally {
|
|
7943
|
+
dispatch({ type: "SET_REGISTERING_PASSKEY", value: false });
|
|
7944
|
+
}
|
|
7945
|
+
}, [knownCredentialIds, activateExistingCredential, dispatch]);
|
|
7946
|
+
const handleCreateNewPasskey = react.useCallback(async () => {
|
|
7947
|
+
dispatch({ type: "SET_REGISTERING_PASSKEY", value: true });
|
|
7948
|
+
dispatch({ type: "SET_ERROR", error: null });
|
|
7949
|
+
try {
|
|
7950
|
+
const passkeyDisplayName = user?.email?.address ?? user?.google?.name ?? user?.id ?? "Blink User";
|
|
7951
|
+
const { credentialId, publicKey } = await createPasskeyCredential({
|
|
7952
|
+
userId: user?.id ?? "unknown",
|
|
7953
|
+
displayName: passkeyDisplayName
|
|
7954
|
+
});
|
|
7955
|
+
await completePasskeyRegistration(credentialId, publicKey);
|
|
7956
|
+
} catch (err) {
|
|
7957
|
+
if (err instanceof PasskeyIframeBlockedError) {
|
|
7958
|
+
dispatch({ type: "SET_PASSKEY_POPUP_NEEDED", needed: true });
|
|
7959
|
+
} else {
|
|
7960
|
+
captureException(err);
|
|
7961
|
+
dispatch({
|
|
7962
|
+
type: "SET_ERROR",
|
|
7963
|
+
error: err instanceof Error ? err.message : "Failed to register passkey"
|
|
7964
|
+
});
|
|
7965
|
+
}
|
|
7966
|
+
} finally {
|
|
7967
|
+
dispatch({ type: "SET_REGISTERING_PASSKEY", value: false });
|
|
7968
|
+
}
|
|
7969
|
+
}, [user, completePasskeyRegistration, dispatch]);
|
|
7870
7970
|
const handleCreatePasskeyViaPopup = react.useCallback(async () => {
|
|
7871
7971
|
dispatch({ type: "SET_REGISTERING_PASSKEY", value: true });
|
|
7872
7972
|
dispatch({ type: "SET_ERROR", error: null });
|
|
@@ -7913,6 +8013,35 @@ function usePasskeyHandlers(dispatch, apiBaseUrl, accounts, knownCredentialIds)
|
|
|
7913
8013
|
dispatch({ type: "SET_REGISTERING_PASSKEY", value: false });
|
|
7914
8014
|
}
|
|
7915
8015
|
}, [user, knownCredentialIds, getAccessToken, apiBaseUrl, activateExistingCredential, dispatch]);
|
|
8016
|
+
const handleCreateNewPasskeyViaPopup = react.useCallback(async () => {
|
|
8017
|
+
dispatch({ type: "SET_REGISTERING_PASSKEY", value: true });
|
|
8018
|
+
dispatch({ type: "SET_ERROR", error: null });
|
|
8019
|
+
try {
|
|
8020
|
+
const token = await getAccessToken();
|
|
8021
|
+
const passkeyDisplayName = user?.email?.address ?? user?.google?.name ?? user?.id ?? "Blink User";
|
|
8022
|
+
const popupOptions = buildPasskeyPopupOptions({
|
|
8023
|
+
userId: user?.id ?? "unknown",
|
|
8024
|
+
displayName: passkeyDisplayName,
|
|
8025
|
+
authToken: token ?? void 0,
|
|
8026
|
+
apiBaseUrl
|
|
8027
|
+
});
|
|
8028
|
+
const { credentialId, publicKey } = await createPasskeyViaPopup(popupOptions);
|
|
8029
|
+
dispatch({ type: "PASSKEY_ACTIVATED", credentialId, publicKey });
|
|
8030
|
+
localStorage.setItem(ACTIVE_CREDENTIAL_STORAGE_KEY, credentialId);
|
|
8031
|
+
if (token) {
|
|
8032
|
+
reportPasskeyActivity(apiBaseUrl, token, credentialId).catch(() => {
|
|
8033
|
+
});
|
|
8034
|
+
}
|
|
8035
|
+
} catch (err) {
|
|
8036
|
+
captureException(err);
|
|
8037
|
+
dispatch({
|
|
8038
|
+
type: "SET_ERROR",
|
|
8039
|
+
error: err instanceof Error ? err.message : "Failed to register passkey"
|
|
8040
|
+
});
|
|
8041
|
+
} finally {
|
|
8042
|
+
dispatch({ type: "SET_REGISTERING_PASSKEY", value: false });
|
|
8043
|
+
}
|
|
8044
|
+
}, [user, getAccessToken, apiBaseUrl, dispatch]);
|
|
7916
8045
|
const handleVerifyPasskeyViaPopup = react.useCallback(async () => {
|
|
7917
8046
|
dispatch({ type: "SET_VERIFYING_PASSKEY", value: true });
|
|
7918
8047
|
dispatch({ type: "SET_ERROR", error: null });
|
|
@@ -7955,7 +8084,10 @@ function usePasskeyHandlers(dispatch, apiBaseUrl, accounts, knownCredentialIds)
|
|
|
7955
8084
|
}, [knownCredentialIds, getAccessToken, apiBaseUrl, dispatch]);
|
|
7956
8085
|
return {
|
|
7957
8086
|
handleRegisterPasskey,
|
|
8087
|
+
handleVerifyPasskey,
|
|
8088
|
+
handleCreateNewPasskey,
|
|
7958
8089
|
handleCreatePasskeyViaPopup,
|
|
8090
|
+
handleCreateNewPasskeyViaPopup,
|
|
7959
8091
|
handleVerifyPasskeyViaPopup,
|
|
7960
8092
|
checkingPasskeyRef
|
|
7961
8093
|
};
|
|
@@ -9573,28 +9705,6 @@ function usePasskeyCheckEffect(deps) {
|
|
|
9573
9705
|
await restoreState(activeCredentialId, token);
|
|
9574
9706
|
return;
|
|
9575
9707
|
}
|
|
9576
|
-
if (cancelled) return;
|
|
9577
|
-
const credentialIds = allPasskeys.map((p) => p.credentialId);
|
|
9578
|
-
let matched = null;
|
|
9579
|
-
if (isSafari() && isInCrossOriginIframe()) {
|
|
9580
|
-
matched = await findDevicePasskeyViaPopup({
|
|
9581
|
-
credentialIds,
|
|
9582
|
-
rpId: resolvePasskeyRpId(),
|
|
9583
|
-
authToken: token ?? void 0,
|
|
9584
|
-
apiBaseUrl
|
|
9585
|
-
});
|
|
9586
|
-
} else {
|
|
9587
|
-
matched = await findDevicePasskey(credentialIds);
|
|
9588
|
-
}
|
|
9589
|
-
if (cancelled) return;
|
|
9590
|
-
if (matched) {
|
|
9591
|
-
const publicKey = allPasskeys.find((p) => p.credentialId === matched)?.publicKey;
|
|
9592
|
-
dispatch({ type: "PASSKEY_ACTIVATED", credentialId: matched, publicKey });
|
|
9593
|
-
window.localStorage.setItem(ACTIVE_CREDENTIAL_STORAGE_KEY, matched);
|
|
9594
|
-
reportPasskeyActivity(apiBaseUrl, token, matched).catch(() => {
|
|
9595
|
-
});
|
|
9596
|
-
await restoreState(matched, token);
|
|
9597
|
-
}
|
|
9598
9708
|
} catch (err) {
|
|
9599
9709
|
dispatch({
|
|
9600
9710
|
type: "PASSKEY_CONFIG_LOADED",
|
|
@@ -10657,7 +10767,7 @@ function BlinkPaymentInner({
|
|
|
10657
10767
|
paymentReducer,
|
|
10658
10768
|
{
|
|
10659
10769
|
depositAmount,
|
|
10660
|
-
passkeyPopupNeeded: isSafari() && isInCrossOriginIframe(),
|
|
10770
|
+
passkeyPopupNeeded: isSafari() && isInCrossOriginIframe() && !isDesktop,
|
|
10661
10771
|
activeCredentialId: typeof window === "undefined" ? null : window.localStorage.getItem(ACTIVE_CREDENTIAL_STORAGE_KEY)
|
|
10662
10772
|
},
|
|
10663
10773
|
createInitialState
|
|
@@ -11013,7 +11123,10 @@ function BlinkPaymentInner({
|
|
|
11013
11123
|
dispatch({ type: "BACK_TO_LOGIN" });
|
|
11014
11124
|
},
|
|
11015
11125
|
onRegisterPasskey: passkey.handleRegisterPasskey,
|
|
11126
|
+
onVerifyPasskey: passkey.handleVerifyPasskey,
|
|
11127
|
+
onCreateNewPasskey: passkey.handleCreateNewPasskey,
|
|
11016
11128
|
onCreatePasskeyViaPopup: passkey.handleCreatePasskeyViaPopup,
|
|
11129
|
+
onCreateNewPasskeyViaPopup: passkey.handleCreateNewPasskeyViaPopup,
|
|
11017
11130
|
onVerifyPasskeyViaPopup: passkey.handleVerifyPasskeyViaPopup,
|
|
11018
11131
|
onPrepareProvider: provider.handlePrepareProvider,
|
|
11019
11132
|
onSelectProvider: provider.handleSelectProvider,
|
|
@@ -11169,6 +11282,7 @@ exports.darkTheme = darkTheme;
|
|
|
11169
11282
|
exports.deviceHasPasskey = deviceHasPasskey;
|
|
11170
11283
|
exports.findDevicePasskey = findDevicePasskey;
|
|
11171
11284
|
exports.findDevicePasskeyViaPopup = findDevicePasskeyViaPopup;
|
|
11285
|
+
exports.getDeviceBiometricUnlockText = getDeviceBiometricUnlockText;
|
|
11172
11286
|
exports.getTheme = getTheme;
|
|
11173
11287
|
exports.guestEntryMatchingRecommended = guestEntryMatchingRecommended;
|
|
11174
11288
|
exports.isAuthorizationSessionCancelled = isAuthorizationSessionCancelled;
|