diff options
author | Matthew Miller <matthew@millerti.me> | 2023-09-27 22:30:20 -0700 |
---|---|---|
committer | Matthew Miller <matthew@millerti.me> | 2023-09-27 22:30:20 -0700 |
commit | 1e208cb61b39f5c7aecd2c35dc9f431fa4641032 (patch) | |
tree | 4b0064a14f7c3efd9ce4fcd99ffdf7647f9aab35 /packages/browser/src/methods/startRegistration.ts | |
parent | 631ffb451525b33a2a4bc1f85a14a6105fb3ba47 (diff) |
Swallow errors from getters during registration
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 { |