mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 23:52:50 -05:00
[PS-589] Fix emergency contact takeover device verification and endpoints for its settings (#2016)
* Added UnknownDeviceVerificationEnabled on User that is turned off when emergency contact takes over the account. Also added endpoints to get and update 2fa device verification settings. And Updated migrations & tests * Applied dotnet format * Fixed method rename call on TwoFactorController * PS-589 Format fixes * PS-589 changed UnknownDeviceVerificationEnabled to be non-nullable
This commit is contained in:

committed by
GitHub

parent
16c6b23a27
commit
b070e9a387
18
src/Api/Models/Request/DeviceVerificationRequestModel.cs
Normal file
18
src/Api/Models/Request/DeviceVerificationRequestModel.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Bit.Core.Entities;
|
||||
|
||||
namespace Bit.Api.Models.Request
|
||||
{
|
||||
public class DeviceVerificationRequestModel
|
||||
{
|
||||
[Required]
|
||||
public bool UnknownDeviceVerificationEnabled { get; set; }
|
||||
|
||||
public User ToUser(User user)
|
||||
{
|
||||
user.UnknownDeviceVerificationEnabled = UnknownDeviceVerificationEnabled;
|
||||
return user;
|
||||
}
|
||||
}
|
||||
}
|
18
src/Api/Models/Response/DeviceVerificationResponseModel.cs
Normal file
18
src/Api/Models/Response/DeviceVerificationResponseModel.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using Bit.Core.Models.Api;
|
||||
|
||||
namespace Bit.Api.Models.Response
|
||||
{
|
||||
public class DeviceVerificationResponseModel : ResponseModel
|
||||
{
|
||||
public DeviceVerificationResponseModel(bool isDeviceVerificationSectionEnabled, bool unknownDeviceVerificationEnabled)
|
||||
: base("deviceVerificationSettings")
|
||||
{
|
||||
IsDeviceVerificationSectionEnabled = isDeviceVerificationSectionEnabled;
|
||||
UnknownDeviceVerificationEnabled = unknownDeviceVerificationEnabled;
|
||||
}
|
||||
|
||||
public bool IsDeviceVerificationSectionEnabled { get; }
|
||||
public bool UnknownDeviceVerificationEnabled { get; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user