diff options
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; } |