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