mirror of
https://github.com/standardnotes/server
synced 2026-10-17 03:03:10 -04:00
fix(auth): upgrade simplewebauthn types
This commit is contained in:
+6
-6
@@ -49,7 +49,7 @@ describe('VerifyAuthenticatorAuthenticationResponse', () => {
|
||||
|
||||
const result = await useCase.execute({
|
||||
userUuid: 'invalid',
|
||||
authenticationCredential: {
|
||||
authenticatorResponse: {
|
||||
authenticatorAttachment: 'platform',
|
||||
clientExtensionResults: {},
|
||||
id: 'id',
|
||||
@@ -77,7 +77,7 @@ describe('VerifyAuthenticatorAuthenticationResponse', () => {
|
||||
|
||||
const result = await useCase.execute({
|
||||
userUuid: '00000000-0000-0000-0000-000000000000',
|
||||
authenticationCredential: {
|
||||
authenticatorResponse: {
|
||||
authenticatorAttachment: 'platform',
|
||||
clientExtensionResults: {},
|
||||
id: 'id',
|
||||
@@ -105,7 +105,7 @@ describe('VerifyAuthenticatorAuthenticationResponse', () => {
|
||||
|
||||
const result = await useCase.execute({
|
||||
userUuid: '00000000-0000-0000-0000-000000000000',
|
||||
authenticationCredential: {
|
||||
authenticatorResponse: {
|
||||
authenticatorAttachment: 'platform',
|
||||
clientExtensionResults: {},
|
||||
id: 'id',
|
||||
@@ -134,7 +134,7 @@ describe('VerifyAuthenticatorAuthenticationResponse', () => {
|
||||
|
||||
const result = await useCase.execute({
|
||||
userUuid: '00000000-0000-0000-0000-000000000000',
|
||||
authenticationCredential: {
|
||||
authenticatorResponse: {
|
||||
authenticatorAttachment: 'platform',
|
||||
clientExtensionResults: {},
|
||||
id: 'id',
|
||||
@@ -167,7 +167,7 @@ describe('VerifyAuthenticatorAuthenticationResponse', () => {
|
||||
|
||||
const result = await useCase.execute({
|
||||
userUuid: '00000000-0000-0000-0000-000000000000',
|
||||
authenticationCredential: {
|
||||
authenticatorResponse: {
|
||||
authenticatorAttachment: 'platform',
|
||||
clientExtensionResults: {},
|
||||
id: 'id',
|
||||
@@ -203,7 +203,7 @@ describe('VerifyAuthenticatorAuthenticationResponse', () => {
|
||||
|
||||
const result = await useCase.execute({
|
||||
userUuid: '00000000-0000-0000-0000-000000000000',
|
||||
authenticationCredential: {
|
||||
authenticatorResponse: {
|
||||
authenticatorAttachment: 'platform',
|
||||
clientExtensionResults: {},
|
||||
id: 'id',
|
||||
|
||||
+3
-3
@@ -27,18 +27,18 @@ export class VerifyAuthenticatorAuthenticationResponse implements UseCaseInterfa
|
||||
|
||||
const authenticator = await this.authenticatorRepository.findByUserUuidAndCredentialId(
|
||||
userUuid,
|
||||
Buffer.from(dto.authenticationCredential.id as string),
|
||||
Buffer.from(dto.authenticatorResponse.id as string),
|
||||
)
|
||||
if (!authenticator) {
|
||||
return Result.fail(
|
||||
`Could not verify authenticator authentication response: authenticator ${dto.authenticationCredential.id} not found`,
|
||||
`Could not verify authenticator authentication response: authenticator ${dto.authenticatorResponse.id} not found`,
|
||||
)
|
||||
}
|
||||
|
||||
let verification: VerifiedAuthenticationResponse
|
||||
try {
|
||||
verification = await verifyAuthenticationResponse({
|
||||
credential: dto.authenticationCredential,
|
||||
response: dto.authenticatorResponse,
|
||||
expectedChallenge: authenticatorChallenge.props.challenge.toString(),
|
||||
expectedOrigin: `https://${this.relyingPartyId}`,
|
||||
expectedRPID: this.relyingPartyId,
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
export interface VerifyAuthenticatorAuthenticationResponseDTO {
|
||||
userUuid: string
|
||||
authenticationCredential: Record<string, unknown>
|
||||
authenticatorResponse: Record<string, unknown>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user