diff options
author | Matthew Miller <matthew@millerti.me> | 2023-09-27 22:42:59 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-27 22:42:59 -0700 |
commit | 75fb63dc3de2cb9dede7e31c88f5ec29d3db1a29 (patch) | |
tree | b5ceff5d86dfd51bf483eac3d0505463cfcc4af8 /packages/browser/src/methods/startRegistration.ts | |
parent | 631ffb451525b33a2a4bc1f85a14a6105fb3ba47 (diff) | |
parent | dc9965a4653cf8cd9662fab0f638a68c8463ec21 (diff) |
Merge pull request #443 from MasterKale/fix/438-handle-bad-publickey-getters
fix/438-handle-bad-publickey-getters
Diffstat (limited to 'packages/browser/src/methods/startRegistration.ts')
-rw-r--r-- | packages/browser/src/methods/startRegistration.ts | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/packages/browser/src/methods/startRegistration.ts b/packages/browser/src/methods/startRegistration.ts index 74da7fd..9f4a104 100644 --- a/packages/browser/src/methods/startRegistration.ts +++ b/packages/browser/src/methods/startRegistration.ts @@ -67,23 +67,35 @@ export async function startRegistration( // L3 says this is required, but browser and webview support are still not guaranteed. let responsePublicKeyAlgorithm: number | undefined = undefined; if (typeof response.getPublicKeyAlgorithm === 'function') { - responsePublicKeyAlgorithm = response.getPublicKeyAlgorithm(); + try { + responsePublicKeyAlgorithm = response.getPublicKeyAlgorithm(); + } catch (error) { + // pass + } } let responsePublicKey: string | undefined = undefined; if (typeof response.getPublicKey === 'function') { - const _publicKey = response.getPublicKey(); - if (_publicKey !== null) { - responsePublicKey = bufferToBase64URLString(_publicKey); + try { + const _publicKey = response.getPublicKey(); + if (_publicKey !== null) { + responsePublicKey = bufferToBase64URLString(_publicKey); + } + } catch (error) { + // pass } } // L3 says this is required, but browser and webview support are still not guaranteed. let responseAuthenticatorData: string | undefined; if (typeof response.getAuthenticatorData === 'function') { - responseAuthenticatorData = bufferToBase64URLString( - response.getAuthenticatorData(), - ); + try { + responseAuthenticatorData = bufferToBase64URLString( + response.getAuthenticatorData(), + ); + } catch (error) { + // pass + } } return { |