@swype-org/react-sdk 0.1.24 → 0.1.26
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 +6 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -796,7 +796,7 @@ async function deviceHasPasskey(credentialId) {
|
|
|
796
796
|
type: "public-key",
|
|
797
797
|
id: base64ToBytes(credentialId)
|
|
798
798
|
}],
|
|
799
|
-
userVerification: "
|
|
799
|
+
userVerification: "discouraged",
|
|
800
800
|
timeout: 3e4
|
|
801
801
|
}
|
|
802
802
|
});
|
|
@@ -1058,10 +1058,10 @@ async function executeSignPermit2(action, wagmiConfig2, apiBaseUrl, sessionId) {
|
|
|
1058
1058
|
primaryType: parsed.primaryType,
|
|
1059
1059
|
message: parsed.message
|
|
1060
1060
|
});
|
|
1061
|
-
const signature = normalizeSignature(rawSignature);
|
|
1061
|
+
const signature = ownerIsSCA ? rawSignature.startsWith("0x") ? rawSignature : `0x${rawSignature}` : normalizeSignature(rawSignature);
|
|
1062
1062
|
if (ownerIsSCA) {
|
|
1063
1063
|
console.info(
|
|
1064
|
-
`[swype-sdk][sign-permit2] Owner is SCA \u2014
|
|
1064
|
+
`[swype-sdk][sign-permit2] Owner is SCA \u2014 preserving raw signature (${rawSignature.length / 2 - 1}B). Server will validate via EIP-1271.`
|
|
1065
1065
|
);
|
|
1066
1066
|
} else {
|
|
1067
1067
|
const recoverInput = {
|
|
@@ -2267,17 +2267,15 @@ function SwypePayment({
|
|
|
2267
2267
|
const loadingDataRef = useRef(false);
|
|
2268
2268
|
useEffect(() => {
|
|
2269
2269
|
if (!authenticated) return;
|
|
2270
|
+
if (step === "login") return;
|
|
2270
2271
|
if (accounts.length > 0 || loadingDataRef.current) return;
|
|
2272
|
+
if (!activeCredentialId) return;
|
|
2271
2273
|
let cancelled = false;
|
|
2272
2274
|
loadingDataRef.current = true;
|
|
2273
2275
|
const load = async () => {
|
|
2274
2276
|
setLoadingData(true);
|
|
2275
2277
|
setError(null);
|
|
2276
2278
|
try {
|
|
2277
|
-
if (!activeCredentialId) {
|
|
2278
|
-
setStep("register-passkey");
|
|
2279
|
-
return;
|
|
2280
|
-
}
|
|
2281
2279
|
const token = await getAccessToken();
|
|
2282
2280
|
if (!token) throw new Error("Not authenticated");
|
|
2283
2281
|
const [prov, accts, chn] = await Promise.all([
|
|
@@ -2314,7 +2312,7 @@ function SwypePayment({
|
|
|
2314
2312
|
cancelled = true;
|
|
2315
2313
|
loadingDataRef.current = false;
|
|
2316
2314
|
};
|
|
2317
|
-
}, [authenticated, accounts.length, apiBaseUrl, getAccessToken, activeCredentialId]);
|
|
2315
|
+
}, [authenticated, step, accounts.length, apiBaseUrl, getAccessToken, activeCredentialId]);
|
|
2318
2316
|
useEffect(() => {
|
|
2319
2317
|
if (!polling.transfer) return;
|
|
2320
2318
|
if (polling.transfer.status === "COMPLETED") {
|