mirror of
https://github.com/bitwarden/mobile
synced 2025-12-14 07:13:33 +00:00
clear cipher cache when replacing ios autofill identities (#1112)
* clear cipher cache when replacing ios autofill identities * changed to be service-centric * support for multiple cache keys * async suffix * added cache keys for android
This commit is contained in:
@@ -163,7 +163,6 @@ namespace Bit.App
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine("XF App: OnStart");
|
||||
await ClearCacheIfNeededAsync();
|
||||
await TryClearCiphersCacheAsync();
|
||||
Prime();
|
||||
if (string.IsNullOrWhiteSpace(Options.Uri))
|
||||
{
|
||||
@@ -214,7 +213,6 @@ namespace Bit.App
|
||||
_messagingService.Send("cancelVaultTimeoutTimer");
|
||||
_messagingService.Send("startEventTimer");
|
||||
await ClearCacheIfNeededAsync();
|
||||
await TryClearCiphersCacheAsync();
|
||||
Prime();
|
||||
SyncIfNeeded();
|
||||
if (Current.MainPage is NavigationPage navPage && navPage.CurrentPage is LockPage lockPage)
|
||||
@@ -390,20 +388,6 @@ namespace Bit.App
|
||||
});
|
||||
}
|
||||
|
||||
private async Task TryClearCiphersCacheAsync()
|
||||
{
|
||||
if (Device.RuntimePlatform != Device.iOS)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var clearCache = await _storageService.GetAsync<bool?>(Constants.ClearCiphersCacheKey);
|
||||
if (clearCache.GetValueOrDefault())
|
||||
{
|
||||
_cipherService.ClearCache();
|
||||
await _storageService.RemoveAsync(Constants.ClearCiphersCacheKey);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task LockedAsync(bool autoPromptBiometric)
|
||||
{
|
||||
await _stateService.PurgeAsync();
|
||||
|
||||
Reference in New Issue
Block a user