@volr/react 0.1.121 → 0.1.122
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 +34 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +34 -9
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -18476,12 +18476,22 @@ async function resolveSigner(input) {
|
|
|
18476
18476
|
return { signer, activeProvider: provider };
|
|
18477
18477
|
}
|
|
18478
18478
|
if (user?.keyStorageType === "passkey" && user.blobUrl && user.prfInput && user.id) {
|
|
18479
|
+
const currentRpId = typeof window !== "undefined" ? window.location.hostname : "localhost";
|
|
18480
|
+
const domainPasskey = user.registeredPasskeys?.find((p) => p.rpId === currentRpId) ?? null;
|
|
18481
|
+
if (user.registeredPasskeys?.length && !domainPasskey) {
|
|
18482
|
+
throw new Error(
|
|
18483
|
+
`PASSKEY_DOMAIN_MISMATCH: No passkey registered for rpId=${currentRpId}`
|
|
18484
|
+
);
|
|
18485
|
+
}
|
|
18486
|
+
const blobUrl = domainPasskey?.blobUrl ?? user.blobUrl;
|
|
18487
|
+
const prfInput = domainPasskey?.prfInput ?? user.prfInput;
|
|
18488
|
+
const credentialId = domainPasskey?.credentialId ?? user.credentialId;
|
|
18479
18489
|
const { provider: restoredProvider } = await restorePasskey({
|
|
18480
18490
|
client,
|
|
18481
18491
|
userId: user.id,
|
|
18482
|
-
blobUrl
|
|
18483
|
-
prfInput
|
|
18484
|
-
credentialId
|
|
18492
|
+
blobUrl,
|
|
18493
|
+
prfInput,
|
|
18494
|
+
credentialId
|
|
18485
18495
|
});
|
|
18486
18496
|
await setProvider(restoredProvider);
|
|
18487
18497
|
try {
|
|
@@ -18786,11 +18796,24 @@ function useVolr() {
|
|
|
18786
18796
|
"No wallet provider available. Please complete passkey enrollment first."
|
|
18787
18797
|
);
|
|
18788
18798
|
}
|
|
18789
|
-
if (!user.
|
|
18799
|
+
if (!user.id) {
|
|
18790
18800
|
throw new Error(
|
|
18791
18801
|
"Missing passkey data. Please re-enroll your passkey."
|
|
18792
18802
|
);
|
|
18793
18803
|
}
|
|
18804
|
+
const currentRpId = typeof window !== "undefined" ? window.location.hostname : "localhost";
|
|
18805
|
+
const domainPasskey = user.registeredPasskeys?.find((p) => p.rpId === currentRpId) ?? null;
|
|
18806
|
+
const blobUrl = domainPasskey?.blobUrl ?? user.blobUrl;
|
|
18807
|
+
const prfInput = domainPasskey?.prfInput ?? user.prfInput;
|
|
18808
|
+
const credentialId = domainPasskey?.credentialId ?? user.credentialId;
|
|
18809
|
+
if (user.registeredPasskeys?.length && !domainPasskey) {
|
|
18810
|
+
throw new Error(
|
|
18811
|
+
`PASSKEY_DOMAIN_MISMATCH: No passkey registered for rpId=${currentRpId}`
|
|
18812
|
+
);
|
|
18813
|
+
}
|
|
18814
|
+
if (!blobUrl || !prfInput) {
|
|
18815
|
+
throw new Error("Missing passkey data. Please re-enroll your passkey.");
|
|
18816
|
+
}
|
|
18794
18817
|
if (restoringRef.current) {
|
|
18795
18818
|
return restoringRef.current;
|
|
18796
18819
|
}
|
|
@@ -18798,9 +18821,9 @@ function useVolr() {
|
|
|
18798
18821
|
restoringRef.current = restorePasskey({
|
|
18799
18822
|
client: apiClient,
|
|
18800
18823
|
userId: user.id,
|
|
18801
|
-
blobUrl
|
|
18802
|
-
prfInput
|
|
18803
|
-
credentialId
|
|
18824
|
+
blobUrl,
|
|
18825
|
+
prfInput,
|
|
18826
|
+
credentialId
|
|
18804
18827
|
}).then(async ({ provider: restoredProvider }) => {
|
|
18805
18828
|
await setProvider(restoredProvider);
|
|
18806
18829
|
console.log("[useVolr] Passkey provider restored successfully");
|
|
@@ -18995,7 +19018,8 @@ function useVolrLogin() {
|
|
|
18995
19018
|
lastWalletChainId: u.lastWalletChainId ?? void 0,
|
|
18996
19019
|
blobUrl: u.blobUrl ?? void 0,
|
|
18997
19020
|
prfInput: u.prfInput ?? void 0,
|
|
18998
|
-
credentialId: u.credentialId ?? void 0
|
|
19021
|
+
credentialId: u.credentialId ?? void 0,
|
|
19022
|
+
registeredPasskeys: u.registeredPasskeys ?? void 0
|
|
18999
19023
|
};
|
|
19000
19024
|
}, []);
|
|
19001
19025
|
const apiBaseUrl = resolveApiBaseUrl(config);
|
|
@@ -19212,7 +19236,8 @@ function useVolrAuthCallback(options = {}) {
|
|
|
19212
19236
|
lastWalletChainId: u.lastWalletChainId ?? void 0,
|
|
19213
19237
|
blobUrl: u.blobUrl ?? void 0,
|
|
19214
19238
|
prfInput: u.prfInput ?? void 0,
|
|
19215
|
-
credentialId: u.credentialId ?? void 0
|
|
19239
|
+
credentialId: u.credentialId ?? void 0,
|
|
19240
|
+
registeredPasskeys: u.registeredPasskeys ?? void 0
|
|
19216
19241
|
};
|
|
19217
19242
|
}, []);
|
|
19218
19243
|
react.useEffect(() => {
|