feat(auth): add configurable user verification requirement on u2f via env vars

This commit is contained in:
Karol Sójko
2023-01-23 15:31:49 +01:00
parent ba08c6a707
commit c38817c62e
6 changed files with 12 additions and 0 deletions
@@ -18,6 +18,7 @@ describe('VerifyAuthenticatorAuthenticationResponse', () => {
authenticatorChallengeRepository,
'standardnotes.com',
'https://app.standardnotes.com',
true,
)
beforeEach(() => {
@@ -12,6 +12,7 @@ export class VerifyAuthenticatorAuthenticationResponse implements UseCaseInterfa
private authenticatorChallengeRepository: AuthenticatorChallengeRepositoryInterface,
private relyingPartyId: string,
private expectedOrigin: string,
private requireUserVerification: boolean,
) {}
async execute(dto: VerifyAuthenticatorAuthenticationResponseDTO): Promise<Result<boolean>> {
@@ -43,6 +44,7 @@ export class VerifyAuthenticatorAuthenticationResponse implements UseCaseInterfa
expectedChallenge: authenticatorChallenge.props.challenge.toString(),
expectedOrigin: this.expectedOrigin,
expectedRPID: this.relyingPartyId,
requireUserVerification: this.requireUserVerification,
authenticator: {
counter: authenticator.props.counter,
credentialID: authenticator.props.credentialId,