From 73b2ae71a916cfacb0c57a9df1c317e9e3d99951 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 21 Sep 2018 23:29:05 -0400 Subject: [PATCH] copy totp code. derp --- src/iOS.Autofill/CredentialProviderViewController.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/iOS.Autofill/CredentialProviderViewController.cs b/src/iOS.Autofill/CredentialProviderViewController.cs index 4de801bb2..467359d86 100644 --- a/src/iOS.Autofill/CredentialProviderViewController.cs +++ b/src/iOS.Autofill/CredentialProviderViewController.cs @@ -3,6 +3,7 @@ using Bit.App.Abstractions; using Bit.App.Repositories; using Bit.App.Resources; using Bit.App.Services; +using Bit.App.Utilities; using Bit.iOS.Autofill.Models; using Bit.iOS.Core; using Bit.iOS.Core.Services; @@ -233,9 +234,15 @@ namespace Bit.iOS.Autofill 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), - cipher.Login.Password?.Decrypt(cipher.OrganizationId), - cipher.Login.Totp?.Decrypt(cipher.OrganizationId)); + cipher.Login.Password?.Decrypt(cipher.OrganizationId), totpCode); } private void CheckLock(Action notLockedAction)