summaryrefslogtreecommitdiffhomepage
path: root/packages/browser/src/methods/startAttestation.ts
diff options
context:
space:
mode:
authorMatthew Miller <matthew@millerti.me>2020-10-07 11:52:11 -0700
committerGitHub <noreply@github.com>2020-10-07 11:52:11 -0700
commit7b5faa5b17ed0470bd017248912bec72a9b6874a (patch)
tree91b24a248fdccc91cea64961b75aeed0581ff5b6 /packages/browser/src/methods/startAttestation.ts
parentd077fc8339d70b3f760db61a92f3d0d89f9b6437 (diff)
parente3fa83bb574fd8cce3280db6a66b478acc95f1af (diff)
Merge pull request #58 from MasterKale/feature/improve-browser-credential-selection
feature/improve-browser-credential-selection
Diffstat (limited to 'packages/browser/src/methods/startAttestation.ts')
-rw-r--r--packages/browser/src/methods/startAttestation.ts11
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;
}