mirror of
https://github.com/bitwarden/mobile
synced 2025-12-27 21:53:57 +00:00
EC-312 Fix crash on entering invalid credentials five times on Autofill (#1988)
This commit is contained in:
committed by
GitHub
parent
2d2a883b96
commit
d2fbf5bdea
@@ -8,5 +8,6 @@ namespace Bit.App.Abstractions
|
||||
{
|
||||
void Init(Func<AppOptions> getOptionsFunc, IAccountsManagerHost accountsManagerHost);
|
||||
Task NavigateOnAccountChangeAsync(bool? isAuthed = null);
|
||||
Task LogOutAsync(string userId, bool userInitiated, bool expired);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -301,7 +301,7 @@ namespace Bit.App
|
||||
UpdateThemeAsync();
|
||||
};
|
||||
Current.MainPage = new NavigationPage(new HomePage(Options));
|
||||
var mainPageTask = _accountsManager.NavigateOnAccountChangeAsync();
|
||||
_accountsManager.NavigateOnAccountChangeAsync().FireAndForget();
|
||||
ServiceContainer.Resolve<MobilePlatformUtilsService>("platformUtilsService").Init();
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +123,11 @@ namespace Bit.App.Utilities.AccountManagement
|
||||
await _vaultTimeoutService.LockAsync(true);
|
||||
break;
|
||||
case AccountsManagerMessageCommands.LOGOUT:
|
||||
await Device.InvokeOnMainThreadAsync(() => LogOutAsync(message.Data as Tuple<string, bool, bool>));
|
||||
var extras = message.Data as Tuple<string, bool, bool>;
|
||||
var userId = extras?.Item1;
|
||||
var userInitiated = extras?.Item2 ?? true;
|
||||
var expired = extras?.Item3 ?? false;
|
||||
await Device.InvokeOnMainThreadAsync(() => LogOutAsync(userId, userInitiated, expired));
|
||||
break;
|
||||
case AccountsManagerMessageCommands.LOGGED_OUT:
|
||||
// Clean up old migrated key if they ever log out.
|
||||
@@ -181,12 +185,8 @@ namespace Bit.App.Utilities.AccountManagement
|
||||
});
|
||||
}
|
||||
|
||||
private async Task LogOutAsync(Tuple<string, bool, bool> extras)
|
||||
public async Task LogOutAsync(string userId, bool userInitiated, bool expired)
|
||||
{
|
||||
var userId = extras?.Item1;
|
||||
var userInitiated = extras?.Item2 ?? true;
|
||||
var expired = extras?.Item3 ?? false;
|
||||
|
||||
await AppHelpers.LogOutAsync(userId, userInitiated);
|
||||
await NavigateOnAccountChangeAsync();
|
||||
_authService.LogOut(() =>
|
||||
|
||||
Reference in New Issue
Block a user