diff --git a/src/Core/Models/Api/Request/TwoFactorRequestModels.cs b/src/Core/Models/Api/Request/TwoFactorRequestModels.cs index 3a48d40bb..3b9659606 100644 --- a/src/Core/Models/Api/Request/TwoFactorRequestModels.cs +++ b/src/Core/Models/Api/Request/TwoFactorRequestModels.cs @@ -220,14 +220,8 @@ namespace Bit.Core.Models.Api public string MasterPasswordHash { get; set; } } - public class TwoFactorRecoveryRequestModel + public class TwoFactorRecoveryRequestModel : TwoFactorEmailRequestModel { - [Required] - [EmailAddress] - [StringLength(50)] - public string Email { get; set; } - [Required] - public string MasterPasswordHash { get; set; } [Required] [StringLength(32)] public string RecoveryCode { get; set; } diff --git a/src/Core/Services/Implementations/UserService.cs b/src/Core/Services/Implementations/UserService.cs index 9e7d408d0..8c39781b4 100644 --- a/src/Core/Services/Implementations/UserService.cs +++ b/src/Core/Services/Implementations/UserService.cs @@ -474,7 +474,7 @@ namespace Bit.Core.Services } user.TwoFactorProviders = null; - user.TwoFactorRecoveryCode = null; + user.TwoFactorRecoveryCode = Guid.NewGuid().ToString("N"); await SaveUserAsync(user); return true;