@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.d.cts
CHANGED
|
@@ -111,6 +111,8 @@ interface PrfInputDto {
|
|
|
111
111
|
*/
|
|
112
112
|
interface UserDto {
|
|
113
113
|
id: string;
|
|
114
|
+
projectId: string;
|
|
115
|
+
projectName: string;
|
|
114
116
|
email: string;
|
|
115
117
|
accountId?: string;
|
|
116
118
|
evmAddress?: `0x${string}`;
|
|
@@ -200,6 +202,8 @@ interface DepositConfig {
|
|
|
200
202
|
*/
|
|
201
203
|
interface VolrUser {
|
|
202
204
|
id?: string;
|
|
205
|
+
projectId?: string;
|
|
206
|
+
projectName?: string;
|
|
203
207
|
email?: string;
|
|
204
208
|
accountId?: string;
|
|
205
209
|
evmAddress?: `0x${string}`;
|
package/dist/index.d.ts
CHANGED
|
@@ -111,6 +111,8 @@ interface PrfInputDto {
|
|
|
111
111
|
*/
|
|
112
112
|
interface UserDto {
|
|
113
113
|
id: string;
|
|
114
|
+
projectId: string;
|
|
115
|
+
projectName: string;
|
|
114
116
|
email: string;
|
|
115
117
|
accountId?: string;
|
|
116
118
|
evmAddress?: `0x${string}`;
|
|
@@ -200,6 +202,8 @@ interface DepositConfig {
|
|
|
200
202
|
*/
|
|
201
203
|
interface VolrUser {
|
|
202
204
|
id?: string;
|
|
205
|
+
projectId?: string;
|
|
206
|
+
projectName?: string;
|
|
203
207
|
email?: string;
|
|
204
208
|
accountId?: string;
|
|
205
209
|
evmAddress?: `0x${string}`;
|
package/dist/index.js
CHANGED
|
@@ -18679,6 +18679,8 @@ function useVolrLogin() {
|
|
|
18679
18679
|
const toVolrUser = useCallback((u) => {
|
|
18680
18680
|
return {
|
|
18681
18681
|
id: u.id,
|
|
18682
|
+
projectId: u.projectId,
|
|
18683
|
+
projectName: u.projectName,
|
|
18682
18684
|
email: u.email,
|
|
18683
18685
|
accountId: u.accountId ?? void 0,
|
|
18684
18686
|
evmAddress: u.evmAddress,
|
|
@@ -18894,6 +18896,8 @@ function useVolrAuthCallback(options = {}) {
|
|
|
18894
18896
|
const toVolrUser = useCallback((u) => {
|
|
18895
18897
|
return {
|
|
18896
18898
|
id: u.id,
|
|
18899
|
+
projectId: u.projectId,
|
|
18900
|
+
projectName: u.projectName,
|
|
18897
18901
|
email: u.email,
|
|
18898
18902
|
accountId: u.accountId ?? void 0,
|
|
18899
18903
|
evmAddress: u.evmAddress,
|
|
@@ -19160,7 +19164,7 @@ async function enrollPasskey(params) {
|
|
|
19160
19164
|
userEvmAddress,
|
|
19161
19165
|
projectId,
|
|
19162
19166
|
rpId = typeof window !== "undefined" ? window.location.hostname : "localhost",
|
|
19163
|
-
rpName
|
|
19167
|
+
rpName
|
|
19164
19168
|
} = params;
|
|
19165
19169
|
if (!userId) {
|
|
19166
19170
|
throw new Error("userId is required");
|
|
@@ -19168,6 +19172,9 @@ async function enrollPasskey(params) {
|
|
|
19168
19172
|
if (!projectId) {
|
|
19169
19173
|
throw new Error("projectId is required");
|
|
19170
19174
|
}
|
|
19175
|
+
if (!rpName) {
|
|
19176
|
+
throw new Error("rpName is required");
|
|
19177
|
+
}
|
|
19171
19178
|
if (!baseUrl) {
|
|
19172
19179
|
throw new Error("baseUrl is required");
|
|
19173
19180
|
}
|
|
@@ -19318,7 +19325,17 @@ function usePasskeyEnrollment() {
|
|
|
19318
19325
|
"Access token is required for passkey enrollment. Please login first."
|
|
19319
19326
|
);
|
|
19320
19327
|
}
|
|
19321
|
-
|
|
19328
|
+
if (!user.projectId) {
|
|
19329
|
+
throw new Error(
|
|
19330
|
+
"Project ID is required for passkey enrollment. User data may be incomplete."
|
|
19331
|
+
);
|
|
19332
|
+
}
|
|
19333
|
+
if (!user.projectName) {
|
|
19334
|
+
throw new Error(
|
|
19335
|
+
"Project name is required for passkey enrollment. User data may be incomplete."
|
|
19336
|
+
);
|
|
19337
|
+
}
|
|
19338
|
+
const projectId = user.projectId;
|
|
19322
19339
|
setStep("encrypting");
|
|
19323
19340
|
const result = await enrollPasskey({
|
|
19324
19341
|
client,
|
|
@@ -19327,7 +19344,8 @@ function usePasskeyEnrollment() {
|
|
|
19327
19344
|
userId: user.id,
|
|
19328
19345
|
userEmail: user.email ?? null,
|
|
19329
19346
|
userEvmAddress: user.evmAddress ?? null,
|
|
19330
|
-
projectId
|
|
19347
|
+
projectId,
|
|
19348
|
+
rpName: user.projectName
|
|
19331
19349
|
});
|
|
19332
19350
|
setStep("registering");
|
|
19333
19351
|
if (typeof window !== "undefined") {
|
|
@@ -19335,7 +19353,7 @@ function usePasskeyEnrollment() {
|
|
|
19335
19353
|
}
|
|
19336
19354
|
const passkeyAdapter = createPasskeyAdapter({
|
|
19337
19355
|
rpId: typeof window !== "undefined" ? window.location.hostname : "localhost",
|
|
19338
|
-
rpName:
|
|
19356
|
+
rpName: user.projectName
|
|
19339
19357
|
});
|
|
19340
19358
|
const provider = createPasskeyProvider(passkeyAdapter, {
|
|
19341
19359
|
prfInput: result.prfInput,
|