@volr/react 0.1.91 → 0.1.92
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 +22 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +22 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -18703,6 +18703,8 @@ function useVolrLogin() {
|
|
|
18703
18703
|
const toVolrUser = react.useCallback((u) => {
|
|
18704
18704
|
return {
|
|
18705
18705
|
id: u.id,
|
|
18706
|
+
projectId: u.projectId,
|
|
18707
|
+
projectName: u.projectName,
|
|
18706
18708
|
email: u.email,
|
|
18707
18709
|
accountId: u.accountId ?? void 0,
|
|
18708
18710
|
evmAddress: u.evmAddress,
|
|
@@ -18918,6 +18920,8 @@ function useVolrAuthCallback(options = {}) {
|
|
|
18918
18920
|
const toVolrUser = react.useCallback((u) => {
|
|
18919
18921
|
return {
|
|
18920
18922
|
id: u.id,
|
|
18923
|
+
projectId: u.projectId,
|
|
18924
|
+
projectName: u.projectName,
|
|
18921
18925
|
email: u.email,
|
|
18922
18926
|
accountId: u.accountId ?? void 0,
|
|
18923
18927
|
evmAddress: u.evmAddress,
|
|
@@ -19184,7 +19188,7 @@ async function enrollPasskey(params) {
|
|
|
19184
19188
|
userEvmAddress,
|
|
19185
19189
|
projectId,
|
|
19186
19190
|
rpId = typeof window !== "undefined" ? window.location.hostname : "localhost",
|
|
19187
|
-
rpName
|
|
19191
|
+
rpName
|
|
19188
19192
|
} = params;
|
|
19189
19193
|
if (!userId) {
|
|
19190
19194
|
throw new Error("userId is required");
|
|
@@ -19192,6 +19196,9 @@ async function enrollPasskey(params) {
|
|
|
19192
19196
|
if (!projectId) {
|
|
19193
19197
|
throw new Error("projectId is required");
|
|
19194
19198
|
}
|
|
19199
|
+
if (!rpName) {
|
|
19200
|
+
throw new Error("rpName is required");
|
|
19201
|
+
}
|
|
19195
19202
|
if (!baseUrl) {
|
|
19196
19203
|
throw new Error("baseUrl is required");
|
|
19197
19204
|
}
|
|
@@ -19342,7 +19349,17 @@ function usePasskeyEnrollment() {
|
|
|
19342
19349
|
"Access token is required for passkey enrollment. Please login first."
|
|
19343
19350
|
);
|
|
19344
19351
|
}
|
|
19345
|
-
|
|
19352
|
+
if (!user.projectId) {
|
|
19353
|
+
throw new Error(
|
|
19354
|
+
"Project ID is required for passkey enrollment. User data may be incomplete."
|
|
19355
|
+
);
|
|
19356
|
+
}
|
|
19357
|
+
if (!user.projectName) {
|
|
19358
|
+
throw new Error(
|
|
19359
|
+
"Project name is required for passkey enrollment. User data may be incomplete."
|
|
19360
|
+
);
|
|
19361
|
+
}
|
|
19362
|
+
const projectId = user.projectId;
|
|
19346
19363
|
setStep("encrypting");
|
|
19347
19364
|
const result = await enrollPasskey({
|
|
19348
19365
|
client,
|
|
@@ -19351,7 +19368,8 @@ function usePasskeyEnrollment() {
|
|
|
19351
19368
|
userId: user.id,
|
|
19352
19369
|
userEmail: user.email ?? null,
|
|
19353
19370
|
userEvmAddress: user.evmAddress ?? null,
|
|
19354
|
-
projectId
|
|
19371
|
+
projectId,
|
|
19372
|
+
rpName: user.projectName
|
|
19355
19373
|
});
|
|
19356
19374
|
setStep("registering");
|
|
19357
19375
|
if (typeof window !== "undefined") {
|
|
@@ -19359,7 +19377,7 @@ function usePasskeyEnrollment() {
|
|
|
19359
19377
|
}
|
|
19360
19378
|
const passkeyAdapter = createPasskeyAdapter({
|
|
19361
19379
|
rpId: typeof window !== "undefined" ? window.location.hostname : "localhost",
|
|
19362
|
-
rpName:
|
|
19380
|
+
rpName: user.projectName
|
|
19363
19381
|
});
|
|
19364
19382
|
const provider = sdkCore.createPasskeyProvider(passkeyAdapter, {
|
|
19365
19383
|
prfInput: result.prfInput,
|