diff --git a/src/App/Pages/Vault/ScanPage.xaml.cs b/src/App/Pages/Vault/ScanPage.xaml.cs index 1927e2587..4f87d1b72 100644 --- a/src/App/Pages/Vault/ScanPage.xaml.cs +++ b/src/App/Pages/Vault/ScanPage.xaml.cs @@ -170,27 +170,10 @@ namespace Bit.App.Pages private void AddAuthenticationKey_OnClicked(object sender, EventArgs e) { - var text = ViewModel.TotpAuthenticationKey; - if (!string.IsNullOrWhiteSpace(text)) + if (!string.IsNullOrWhiteSpace(ViewModel.TotpAuthenticationKey)) { - if (text.StartsWith("otpauth://totp")) - { - _callback(text); - return; - } - else if (Uri.TryCreate(text, UriKind.Absolute, out Uri uri) && - !string.IsNullOrWhiteSpace(uri?.Query)) - { - var queryParts = uri.Query.Substring(1).ToLowerInvariant().Split('&'); - foreach (var part in queryParts) - { - if (part.StartsWith("secret=")) - { - _callback(part.Substring(7)?.ToUpperInvariant()); - return; - } - } - } + _callback(ViewModel.TotpAuthenticationKey); + return; } _callback(null); }