Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (!navigator.credentials) {
throw new TransportError("WebAuthn not supported", "NotSupported");
}
return (
navigator.credentials
// $FlowFixMe
.get({
publicKey: {
timeout,
challenge: new Uint8Array(32),
allowCredentials: [
{
type: "public-key",
id: new Uint8Array(wrapApdu(apdu, scrambleKey))
}
]
}
})
// $FlowFixMe
.then(r => Buffer.from(r.response.signature))
);
};