@nibssplc/cams-sdk-react 0.0.1-beta.101 → 0.0.1-beta.102

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.esm.js CHANGED
@@ -561,7 +561,6 @@ 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",
@@ -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("Registration cancelled by user.");
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
  }