mirror of
https://github.com/bitwarden/android.git
synced 2024-12-25 02:18:27 +03:00
only copy totp key is setting not disabled
This commit is contained in:
parent
73b2ae71a9
commit
68e9cd3779
1 changed files with 10 additions and 5 deletions
|
@ -25,6 +25,7 @@ namespace Bit.iOS.Autofill
|
||||||
private Context _context;
|
private Context _context;
|
||||||
private bool _setupHockeyApp = false;
|
private bool _setupHockeyApp = false;
|
||||||
private IGoogleAnalyticsService _googleAnalyticsService;
|
private IGoogleAnalyticsService _googleAnalyticsService;
|
||||||
|
private ISettings _settings;
|
||||||
|
|
||||||
public CredentialProviderViewController(IntPtr handle) : base(handle)
|
public CredentialProviderViewController(IntPtr handle) : base(handle)
|
||||||
{ }
|
{ }
|
||||||
|
@ -37,6 +38,7 @@ namespace Bit.iOS.Autofill
|
||||||
_context = new Context();
|
_context = new Context();
|
||||||
_context.ExtContext = ExtensionContext;
|
_context.ExtContext = ExtensionContext;
|
||||||
_googleAnalyticsService = Resolver.Resolve<IGoogleAnalyticsService>();
|
_googleAnalyticsService = Resolver.Resolve<IGoogleAnalyticsService>();
|
||||||
|
_settings = Resolver.Resolve<ISettings>();
|
||||||
|
|
||||||
if(!_setupHockeyApp)
|
if(!_setupHockeyApp)
|
||||||
{
|
{
|
||||||
|
@ -234,12 +236,15 @@ namespace Bit.iOS.Autofill
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var totpKey = cipher.Login.Totp?.Decrypt(cipher.OrganizationId);
|
|
||||||
string totpCode = null;
|
string totpCode = null;
|
||||||
|
if(!_settings.GetValueOrDefault(App.Constants.SettingDisableTotpCopy, false))
|
||||||
|
{
|
||||||
|
var totpKey = cipher.Login.Totp?.Decrypt(cipher.OrganizationId);
|
||||||
if(!string.IsNullOrWhiteSpace(totpKey))
|
if(!string.IsNullOrWhiteSpace(totpKey))
|
||||||
{
|
{
|
||||||
totpCode = Crypto.Totp(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), totpCode);
|
cipher.Login.Password?.Decrypt(cipher.OrganizationId), totpCode);
|
||||||
|
|
Loading…
Reference in a new issue