mirror of
https://github.com/standardnotes/server
synced 2026-10-17 03:03:10 -04:00
feat(auth): add http endpoints for authenticators
This commit is contained in:
+3
-3
@@ -27,18 +27,18 @@ export class VerifyAuthenticatorAuthenticationResponse implements UseCaseInterfa
|
||||
|
||||
const authenticator = await this.authenticatorRepository.findByUserUuidAndCredentialId(
|
||||
userUuid,
|
||||
Buffer.from(dto.registrationCredential.id as string),
|
||||
Buffer.from(dto.authenticationCredential.id as string),
|
||||
)
|
||||
if (!authenticator) {
|
||||
return Result.fail(
|
||||
`Could not verify authenticator authentication response: authenticator ${dto.registrationCredential.id} not found`,
|
||||
`Could not verify authenticator authentication response: authenticator ${dto.authenticationCredential.id} not found`,
|
||||
)
|
||||
}
|
||||
|
||||
let verification: VerifiedAuthenticationResponse
|
||||
try {
|
||||
verification = await verifyAuthenticationResponse({
|
||||
credential: dto.registrationCredential,
|
||||
credential: dto.authenticationCredential,
|
||||
expectedChallenge: authenticatorChallenge.props.challenge.toString(),
|
||||
expectedOrigin: `https://${RelyingParty.RP_ID}`,
|
||||
expectedRPID: RelyingParty.RP_ID,
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
export interface VerifyAuthenticatorAuthenticationResponseDTO {
|
||||
userUuid: string
|
||||
registrationCredential: Record<string, unknown>
|
||||
authenticationCredential: Record<string, unknown>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user