1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-15 15:53:44 +00:00

refactors for new 2fa flows

This commit is contained in:
Kyle Spearrin
2017-06-27 16:18:32 -04:00
parent 35ae2b783f
commit 4116d95a3e
10 changed files with 254 additions and 95 deletions

View File

@@ -1,4 +1,5 @@
using System;
using Bit.App.Enums;
using System;
using System.Collections.Generic;
namespace Bit.App.Models.Api
@@ -8,10 +9,11 @@ namespace Bit.App.Models.Api
public string Email { get; set; }
public string MasterPasswordHash { get; set; }
public string Token { get; set; }
public int? Provider { get; set; }
public TwoFactorProviderType? Provider { get; set; }
[Obsolete]
public string OldAuthBearer { get; set; }
public DeviceRequest Device { get; set; }
public bool Remember { get; set; }
public IDictionary<string, string> ToIdentityTokenRequest()
{
@@ -40,7 +42,8 @@ namespace Bit.App.Models.Api
if(Token != null && Provider.HasValue)
{
dict.Add("TwoFactorToken", Token);
dict.Add("TwoFactorProvider", Provider.Value.ToString());
dict.Add("TwoFactorProvider", ((byte)(Provider.Value)).ToString());
dict.Add("TwoFactorRemember", Remember ? "1" : "0");
}
return dict;

View File

@@ -1,4 +1,5 @@
using Newtonsoft.Json;
using Bit.App.Enums;
using Newtonsoft.Json;
using System.Collections.Generic;
namespace Bit.App.Models.Api
@@ -13,7 +14,7 @@ namespace Bit.App.Models.Api
public string RefreshToken { get; set; }
[JsonProperty("token_type")]
public string TokenType { get; set; }
public List<int> TwoFactorProviders { get; set; }
public Dictionary<TwoFactorProviderType, Dictionary<string, object>> TwoFactorProviders2 { get; set; }
public string PrivateKey { get; set; }
public string Key { get; set; }
}