@calimero-network/mero-js 29.7.5 → 29.7.6
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/cloud-v2/client.js +18 -10
- package/dist/cloud-v2/passkey.d.ts +7 -5
- package/dist/index.browser.mjs +2 -2
- package/dist/index.browser.mjs.map +3 -3
- package/dist/index.cjs +9 -6
- package/dist/index.cjs.map +2 -2
- package/dist/index.mjs +9 -6
- package/dist/index.mjs.map +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1990,8 +1990,8 @@ function pageDeployment(href) {
|
|
|
1990
1990
|
return null;
|
|
1991
1991
|
}
|
|
1992
1992
|
}
|
|
1993
|
-
function userVerificationOf(named) {
|
|
1994
|
-
return named === "required" || named === "preferred" || named === "discouraged" ? named :
|
|
1993
|
+
function userVerificationOf(named, fallback) {
|
|
1994
|
+
return named === "required" || named === "preferred" || named === "discouraged" ? named : fallback;
|
|
1995
1995
|
}
|
|
1996
1996
|
function promptFailure(error) {
|
|
1997
1997
|
const e = error;
|
|
@@ -2378,10 +2378,13 @@ var CalimeroClient = class _CalimeroClient {
|
|
|
2378
2378
|
origin
|
|
2379
2379
|
);
|
|
2380
2380
|
const registration = await passkey.create(begin.options);
|
|
2381
|
-
const session = await this.
|
|
2381
|
+
const session = await this.confirmed(
|
|
2382
|
+
"POST",
|
|
2382
2383
|
"auth/passkey/register/finish",
|
|
2383
2384
|
{ challengeId: begin.challengeId, registration, ...invite },
|
|
2384
|
-
passkey
|
|
2385
|
+
passkey,
|
|
2386
|
+
void 0,
|
|
2387
|
+
"preferred"
|
|
2385
2388
|
);
|
|
2386
2389
|
this.useSession(session);
|
|
2387
2390
|
return session;
|
|
@@ -2772,7 +2775,7 @@ var CalimeroClient = class _CalimeroClient {
|
|
|
2772
2775
|
deleteConfirmed(path, passkey, body = {}) {
|
|
2773
2776
|
return this.confirmed("DELETE", path, body, passkey);
|
|
2774
2777
|
}
|
|
2775
|
-
async confirmed(method, path, body, passkey, send = (b) => this.json(method, path, b)) {
|
|
2778
|
+
async confirmed(method, path, body, passkey, send = (b) => this.json(method, path, b), userVerification = "required") {
|
|
2776
2779
|
try {
|
|
2777
2780
|
return await send(body);
|
|
2778
2781
|
} catch (error) {
|
|
@@ -2781,7 +2784,7 @@ var CalimeroClient = class _CalimeroClient {
|
|
|
2781
2784
|
let assertion;
|
|
2782
2785
|
try {
|
|
2783
2786
|
assertion = await passkey.get(fromB64url(d.challenge), d.rpId, d.allowCredentials, {
|
|
2784
|
-
userVerification: userVerificationOf(d.userVerification)
|
|
2787
|
+
userVerification: userVerificationOf(d.userVerification, userVerification)
|
|
2785
2788
|
});
|
|
2786
2789
|
} catch (declined) {
|
|
2787
2790
|
throw promptFailure(declined);
|