diff --git a/packages/biometric-ed25519/package.json b/packages/biometric-ed25519/package.json index d846d51fcb..6941767de5 100644 --- a/packages/biometric-ed25519/package.json +++ b/packages/biometric-ed25519/package.json @@ -1,7 +1,7 @@ { "name": "@near-js/biometric-ed25519", "description": "JavaScript library to handle webauthn and biometric keys", - "version": "0.3.0", + "version": "0.4.0", "main": "lib/index.js", "types": "lib/index.d.ts", "scripts": { diff --git a/packages/biometric-ed25519/src/index.ts b/packages/biometric-ed25519/src/index.ts index 4076e1fb94..111fc4be71 100644 --- a/packages/biometric-ed25519/src/index.ts +++ b/packages/biometric-ed25519/src/index.ts @@ -51,6 +51,11 @@ export const createKey = async (username: string): Promise => { setBufferIfUndefined(); return navigator.credentials.create({ publicKey }) .then(async (res) => { + if (!res) { + alert('Passkey process was cancelled, retry to continue account setup.'); + throw new Error('Fail to retrieve respnose from navigator.credentials.create'); + } + const result = await f2l.attestation({ clientAttestationResponse: res, origin,