mirror of
https://github.com/bitwarden/mobile
synced 2026-01-10 04:23:21 +00:00
[AC-1070] Add MasterPasswordPolicy property to Identity responses
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using Bit.Core.Enums;
|
||||
using System.Collections.Generic;
|
||||
using Bit.Core.Enums;
|
||||
using Bit.Core.Models.Domain;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Bit.Core.Models.Response
|
||||
@@ -24,6 +26,7 @@ namespace Bit.Core.Models.Response
|
||||
public int? KdfParallelism { get; set; }
|
||||
public bool ForcePasswordReset { get; set; }
|
||||
public string KeyConnectorUrl { get; set; }
|
||||
public MasterPasswordPolicyOptions MasterPasswordPolicy { get; set; }
|
||||
[JsonIgnore]
|
||||
public KdfConfig KdfConfig => new KdfConfig(Kdf, KdfIterations, KdfMemory, KdfParallelism);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using Bit.Core.Enums;
|
||||
using Bit.Core.Models.Domain;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Bit.Core.Models.Response
|
||||
@@ -8,6 +9,7 @@ namespace Bit.Core.Models.Response
|
||||
{
|
||||
public List<TwoFactorProviderType> TwoFactorProviders { get; set; }
|
||||
public Dictionary<TwoFactorProviderType, Dictionary<string, object>> TwoFactorProviders2 { get; set; }
|
||||
public MasterPasswordPolicyOptions MasterPasswordPolicy { get; set; }
|
||||
[JsonProperty("CaptchaBypassToken")]
|
||||
public string CaptchaToken { get; set; }
|
||||
}
|
||||
|
||||
@@ -130,6 +130,12 @@ namespace Bit.Core.Services
|
||||
{
|
||||
enforcedOptions.RequireSpecial = true;
|
||||
}
|
||||
|
||||
var enforceOnLogin = GetPolicyBool(currentPolicy, "enforceOnLogin");
|
||||
if (enforceOnLogin != null && (bool)enforceOnLogin)
|
||||
{
|
||||
enforcedOptions.EnforceOnLogin = true;
|
||||
}
|
||||
}
|
||||
|
||||
return enforcedOptions;
|
||||
|
||||
Reference in New Issue
Block a user