summaryrefslogtreecommitdiffhomepage
path: root/packages/server/src/authentication/verifyAuthenticationResponse.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/server/src/authentication/verifyAuthenticationResponse.ts')
-rw-r--r--packages/server/src/authentication/verifyAuthenticationResponse.ts11
1 files changed, 8 insertions, 3 deletions
diff --git a/packages/server/src/authentication/verifyAuthenticationResponse.ts b/packages/server/src/authentication/verifyAuthenticationResponse.ts
index 7cacf9c..c6430c0 100644
--- a/packages/server/src/authentication/verifyAuthenticationResponse.ts
+++ b/packages/server/src/authentication/verifyAuthenticationResponse.ts
@@ -1,6 +1,7 @@
import type {
AuthenticationResponseJSON,
AuthenticatorDevice,
+ Base64URLString,
CredentialDeviceType,
UserVerificationRequirement,
} from '../deps.ts';
@@ -94,11 +95,15 @@ export async function verifyAuthenticationResponse(
if (Array.isArray(expectedType)) {
if (!expectedType.includes(type)) {
const joinedExpectedType = expectedType.join(', ');
- throw new Error(`Unexpected authentication response type "${type}", expected one of: ${joinedExpectedType}`);
+ throw new Error(
+ `Unexpected authentication response type "${type}", expected one of: ${joinedExpectedType}`,
+ );
}
} else if (expectedType) {
if (type !== expectedType) {
- throw new Error(`Unexpected authentication response type "${type}", expected "${expectedType}"`);
+ throw new Error(
+ `Unexpected authentication response type "${type}", expected "${expectedType}"`,
+ );
}
} else if (type !== 'webauthn.get') {
throw new Error(`Unexpected authentication response type: ${type}`);
@@ -280,7 +285,7 @@ export async function verifyAuthenticationResponse(
export type VerifiedAuthenticationResponse = {
verified: boolean;
authenticationInfo: {
- credentialID: Uint8Array;
+ credentialID: Base64URLString;
newCounter: number;
userVerified: boolean;
credentialDeviceType: CredentialDeviceType;