mirror of
https://github.com/standardnotes/server
synced 2026-10-17 03:03:10 -04:00
feat(auth): add configuring u2f expect origin
This commit is contained in:
+1
@@ -17,6 +17,7 @@ describe('VerifyAuthenticatorAuthenticationResponse', () => {
|
||||
authenticatorRepository,
|
||||
authenticatorChallengeRepository,
|
||||
'standardnotes.com',
|
||||
'https://app.standardnotes.com',
|
||||
)
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+2
-1
@@ -11,6 +11,7 @@ export class VerifyAuthenticatorAuthenticationResponse implements UseCaseInterfa
|
||||
private authenticatorRepository: AuthenticatorRepositoryInterface,
|
||||
private authenticatorChallengeRepository: AuthenticatorChallengeRepositoryInterface,
|
||||
private relyingPartyId: string,
|
||||
private expectedOrigin: string,
|
||||
) {}
|
||||
|
||||
async execute(dto: VerifyAuthenticatorAuthenticationResponseDTO): Promise<Result<boolean>> {
|
||||
@@ -40,7 +41,7 @@ export class VerifyAuthenticatorAuthenticationResponse implements UseCaseInterfa
|
||||
verification = await verifyAuthenticationResponse({
|
||||
response: dto.authenticatorResponse,
|
||||
expectedChallenge: authenticatorChallenge.props.challenge.toString(),
|
||||
expectedOrigin: `https://${this.relyingPartyId}`,
|
||||
expectedOrigin: this.expectedOrigin,
|
||||
expectedRPID: this.relyingPartyId,
|
||||
authenticator: {
|
||||
counter: authenticator.props.counter,
|
||||
|
||||
Reference in New Issue
Block a user