1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 07:36:14 -05:00

added org duo to 2fa flow

This commit is contained in:
Kyle Spearrin
2018-04-03 14:31:33 -04:00
parent 0d4ea5ce5b
commit 389512d51e
11 changed files with 239 additions and 31 deletions

View File

@ -12,12 +12,15 @@ namespace Bit.Core.Models.Data
Id = organization.Id;
UseEvents = organization.UseEvents;
Use2fa = organization.Use2fa;
Using2fa = organization.Use2fa && organization.TwoFactorProviders != null &&
organization.TwoFactorProviders != "{}";
Enabled = organization.Enabled;
}
public Guid Id { get; set; }
public bool UseEvents { get; set; }
public bool Use2fa { get; set; }
public bool Using2fa { get; set; }
public bool Enabled { get; set; }
}
}

View File

@ -133,6 +133,13 @@ namespace Bit.Core.Models.Table
public void SetTwoFactorProviders(Dictionary<TwoFactorProviderType, TwoFactorProvider> providers)
{
if(!providers.Any())
{
TwoFactorProviders = null;
_twoFactorProviders = null;
return;
}
TwoFactorProviders = JsonConvert.SerializeObject(providers, new JsonSerializerSettings
{
ContractResolver = new EnumKeyResolver<byte>()