1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-11-27 12:26:31 +01:00

copy totp code. derp

This commit is contained in:
Kyle Spearrin 2018-09-21 23:29:05 -04:00
parent f9028245d8
commit 73b2ae71a9

View File

@ -3,6 +3,7 @@ using Bit.App.Abstractions;
using Bit.App.Repositories; using Bit.App.Repositories;
using Bit.App.Resources; using Bit.App.Resources;
using Bit.App.Services; using Bit.App.Services;
using Bit.App.Utilities;
using Bit.iOS.Autofill.Models; using Bit.iOS.Autofill.Models;
using Bit.iOS.Core; using Bit.iOS.Core;
using Bit.iOS.Core.Services; using Bit.iOS.Core.Services;
@ -233,9 +234,15 @@ namespace Bit.iOS.Autofill
return; return;
} }
var totpKey = cipher.Login.Totp?.Decrypt(cipher.OrganizationId);
string totpCode = null;
if(!string.IsNullOrWhiteSpace(totpKey))
{
totpCode = Crypto.Totp(totpKey);
}
CompleteRequest(cipher.Login.Username?.Decrypt(cipher.OrganizationId), CompleteRequest(cipher.Login.Username?.Decrypt(cipher.OrganizationId),
cipher.Login.Password?.Decrypt(cipher.OrganizationId), cipher.Login.Password?.Decrypt(cipher.OrganizationId), totpCode);
cipher.Login.Totp?.Decrypt(cipher.OrganizationId));
} }
private void CheckLock(Action notLockedAction) private void CheckLock(Action notLockedAction)