From 71c4b53999cb55231aa7f2be4f660147355735ef Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Wed, 8 Dec 2021 17:43:21 +0000 Subject: [PATCH] Fix recursive call in TwoFactorWebAuthnDeleteRequestModel (#1750) * Fix recursive call in TwoFactorwebAuthnDeleteRequestModel * Add new befoer IEnumerable * Use virtual and override --- .../Api/Request/Accounts/SecretVerificationRequestModel.cs | 2 +- src/Core/Models/Api/Request/TwoFactorRequestModels.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Core/Models/Api/Request/Accounts/SecretVerificationRequestModel.cs b/src/Core/Models/Api/Request/Accounts/SecretVerificationRequestModel.cs index 03878592b..75d59d1ee 100644 --- a/src/Core/Models/Api/Request/Accounts/SecretVerificationRequestModel.cs +++ b/src/Core/Models/Api/Request/Accounts/SecretVerificationRequestModel.cs @@ -10,7 +10,7 @@ namespace Bit.Core.Models.Api public string OTP { get; set; } public string Secret => !string.IsNullOrEmpty(MasterPasswordHash) ? MasterPasswordHash : OTP; - public IEnumerable Validate(ValidationContext validationContext) + public virtual IEnumerable Validate(ValidationContext validationContext) { if (string.IsNullOrEmpty(Secret)) { diff --git a/src/Core/Models/Api/Request/TwoFactorRequestModels.cs b/src/Core/Models/Api/Request/TwoFactorRequestModels.cs index 21c722888..1ab8bdd69 100644 --- a/src/Core/Models/Api/Request/TwoFactorRequestModels.cs +++ b/src/Core/Models/Api/Request/TwoFactorRequestModels.cs @@ -236,9 +236,9 @@ namespace Bit.Core.Models.Api [Required] public int? Id { get; set; } - public IEnumerable Validate(ValidationContext validationContext) + public override IEnumerable Validate(ValidationContext validationContext) { - foreach (var validationResult in Validate(validationContext)) + foreach (var validationResult in base.Validate(validationContext)) { yield return validationResult; }