From a0fb1e0907eb2fdfce8556bf69f8aa2bd64eae32 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Sat, 24 Jun 2017 16:17:38 -0400 Subject: [PATCH] recover --- src/Core/Models/Api/Request/TwoFactorRequestModels.cs | 8 +------- src/Core/Services/Implementations/UserService.cs | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) 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;