1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-06 02:23:57 +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

@@ -8,6 +8,7 @@ using Plugin.Connectivity.Abstractions;
using System.Net;
using Newtonsoft.Json.Linq;
using System.Collections.Generic;
using Bit.App.Enums;
namespace Bit.App.Repositories
{
@@ -46,11 +47,13 @@ namespace Bit.App.Repositories
if(!response.IsSuccessStatusCode)
{
var errorResponse = JObject.Parse(responseContent);
if(errorResponse["TwoFactorProviders"] != null)
if(errorResponse["TwoFactorProviders2"] != null)
{
return ApiResult<TokenResponse>.Success(new TokenResponse
{
TwoFactorProviders = errorResponse["TwoFactorProviders"].ToObject<List<int>>()
TwoFactorProviders2 =
errorResponse["TwoFactorProviders2"]
.ToObject<Dictionary<TwoFactorProviderType, Dictionary<string, object>>>()
}, response.StatusCode);
}