diff options
author | Matthew Miller <matthew@millerti.me> | 2020-10-05 02:31:31 -0700 |
---|---|---|
committer | Matthew Miller <matthew@millerti.me> | 2020-10-05 02:31:31 -0700 |
commit | 97cbc6a44c0acf4ae409e0193a1f1db30d7eb306 (patch) | |
tree | 55822eb4c9c93d410233792f84c7d96283e5c15e /packages/browser/src/methods/startAttestation.ts | |
parent | 27b07d7ed71eac4b295a9979390c43167b8b8dfb (diff) |
Return authenticator transports when available
Diffstat (limited to 'packages/browser/src/methods/startAttestation.ts')
-rw-r--r-- | packages/browser/src/methods/startAttestation.ts | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/packages/browser/src/methods/startAttestation.ts b/packages/browser/src/methods/startAttestation.ts index b6faa83..0b2235d 100644 --- a/packages/browser/src/methods/startAttestation.ts +++ b/packages/browser/src/methods/startAttestation.ts @@ -43,7 +43,7 @@ export default async function startAttestation( const { id, rawId, response, type } = credential; // Convert values to base64 to make it easier to send back to the server - return { + const credentialJSON: AttestationCredentialJSON = { id, rawId: bufferToBase64URLString(rawId), response: { @@ -52,4 +52,13 @@ export default async function startAttestation( }, type, }; + + /** + * Include the authenticator's transports if the browser supports querying for them + */ + if (typeof response.getTransports === 'function') { + credentialJSON.transports = response.getTransports(); + } + + return credentialJSON; } |