mirror of
https://github.com/bitwarden/server.git
synced 2026-02-09 10:23:10 +08:00
initial commit of source
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Bit.Api.Models
|
||||
{
|
||||
public class UpdateTwoFactorRequestModel : IValidatableObject
|
||||
{
|
||||
[Required]
|
||||
public string MasterPasswordHash { get; set; }
|
||||
[Required]
|
||||
public bool? Enabled { get; set; }
|
||||
public string Token { get; set; }
|
||||
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
if(Enabled.HasValue && Enabled.Value && string.IsNullOrWhiteSpace(Token))
|
||||
{
|
||||
yield return new ValidationResult("Token is required.", new[] { "Token" });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user