@nibssplc/cams-sdk-react 0.0.1-beta.101 → 0.0.1-beta.103
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.js +6 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +6 -3
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -561,14 +561,13 @@ function register(options) {
|
|
|
561
561
|
case 0:
|
|
562
562
|
_k.trys.push([0, 2, , 3]);
|
|
563
563
|
createOptions = __assign(__assign({}, options), { challenge: base64urlToArrayBuffer(options.challenge), user: __assign(__assign({}, options.user), { id: base64urlToArrayBuffer(options.user.id) }) });
|
|
564
|
-
console.log("Creating credential with options:", createOptions, "...\n\n\n", options);
|
|
565
564
|
return [4 /*yield*/, navigator.credentials.create({
|
|
566
565
|
publicKey: __assign(__assign({}, createOptions), { pubKeyCredParams: (_a = options.pubKeyCredParams) === null || _a === void 0 ? void 0 : _a.map(function (param) { return ({
|
|
567
566
|
type: "public-key",
|
|
568
567
|
alg: param.alg,
|
|
569
568
|
}); }), attestation: (((_b = options.attestation) === null || _b === void 0 ? void 0 : _b.toLowerCase()) || "none"), authenticatorSelection: __assign(__assign({}, options.authenticatorSelection), { residentKey: (((_d = (_c = options.authenticatorSelection) === null || _c === void 0 ? void 0 : _c.residentKey) === null || _d === void 0 ? void 0 : _d.toLowerCase()) ||
|
|
570
569
|
"discouraged"), userVerification: (((_f = (_e = options.authenticatorSelection) === null || _e === void 0 ? void 0 : _e.userVerification) === null || _f === void 0 ? void 0 : _f.toLowerCase()) ||
|
|
571
|
-
"
|
|
570
|
+
"discouraged") }) }),
|
|
572
571
|
})];
|
|
573
572
|
case 1:
|
|
574
573
|
credential = _k.sent();
|
|
@@ -589,12 +588,16 @@ function register(options) {
|
|
|
589
588
|
}];
|
|
590
589
|
case 2:
|
|
591
590
|
err_1 = _k.sent();
|
|
591
|
+
console.error("Error during registration:", err_1);
|
|
592
592
|
if (err_1.name === "NotAllowedError") {
|
|
593
|
-
throw new Error("
|
|
593
|
+
throw new Error("Face ID/Touch ID cancelled or failed. Please try again.");
|
|
594
594
|
}
|
|
595
595
|
if (err_1.name === "InvalidStateError") {
|
|
596
596
|
throw new Error("Passkey already registered for this user.");
|
|
597
597
|
}
|
|
598
|
+
if (err_1.name === "NotSupportedError") {
|
|
599
|
+
throw new Error("Passkeys not supported on this device.");
|
|
600
|
+
}
|
|
598
601
|
throw err_1;
|
|
599
602
|
case 3: return [2 /*return*/];
|
|
600
603
|
}
|