misc tweaks and linting clean-up

This commit is contained in:
2024-07-06 13:04:15 -06:00
parent 9677a344c2
commit 6b65e31649
7 changed files with 45 additions and 13 deletions

View File

@@ -1,4 +1,3 @@
import asn1 from "asn1-ber";
import { Buffer } from "buffer/";
import { decode as cborDecode } from "cbor-x";
import { bytesToMultibase, JWTPayload, multibaseToBytes } from "did-jwt";
@@ -195,12 +194,12 @@ export class PeerSetup {
allowCredentials: [
{
id: credentialId,
type: "public-key",
type: "public-key" as const,
},
],
challenge: this.challenge.buffer,
rpID: window.location.hostname,
userVerification: "preferred",
userVerification: "preferred" as const,
},
};
@@ -209,7 +208,7 @@ export class PeerSetup {
this.authenticatorData = credential?.response.authenticatorData;
const authenticatorDataBase64Url = arrayBufferToBase64URLString(
this.authenticatorData,
this.authenticatorData as ArrayBuffer,
);
this.clientDataJsonBase64Url = arrayBufferToBase64URLString(
@@ -249,6 +248,9 @@ export class PeerSetup {
return jwt;
}
// To use this, add the asn1-ber library and add this import:
// import asn1 from "asn1-ber";
//
// return a low-level signing function, similar to createJWS approach
// async webAuthnES256KSigner(credentialID: string) {
// return async (data: string | Uint8Array) => {