Example #1
0
        private async Task LogOutAsync(bool expired)
        {
            var userId = await _userService.GetUserIdAsync();

            await Task.WhenAll(
                _syncService.SetLastSyncAsync(DateTime.MinValue),
                _tokenService.ClearTokenAsync(),
                _cryptoService.ClearKeysAsync(),
                _userService.ClearAsync(),
                _settingsService.ClearAsync(userId),
                _cipherService.ClearAsync(userId),
                _folderService.ClearAsync(userId),
                _collectionService.ClearAsync(userId),
                _passwordGenerationService.ClearAsync(),
                _vaultTimeoutService.ClearAsync(),
                _stateService.PurgeAsync(),
                _deviceActionService.ClearCacheAsync());

            _vaultTimeoutService.BiometricLocked = true;
            _searchService.ClearIndex();
            _authService.LogOut(() =>
            {
                Current.MainPage = new HomePage();
                if (expired)
                {
                    _platformUtilsService.ShowToast("warning", null, AppResources.LoginExpired);
                }
            });
        }
Example #2
0
        private async Task LogOutAsync(bool expired)
        {
            var userId = await _userService.GetUserIdAsync();

            await Task.WhenAll(
                _syncService.SetLastSyncAsync(DateTime.MinValue),
                _tokenService.ClearTokenAsync(),
                _cryptoService.ClearKeysAsync(),
                _userService.ClearAsync(),
                _settingsService.ClearAsync(userId),
                _cipherService.ClearAsync(userId),
                _folderService.ClearAsync(userId),
                _collectionService.ClearAsync(userId),
                _passwordGenerationService.ClearAsync(),
                _lockService.ClearAsync(),
                _stateService.PurgeAsync());

            _lockService.PinLocked         = false;
            _lockService.FingerprintLocked = true;
            _searchService.ClearIndex();
            _authService.LogOut(() =>
            {
                Current.MainPage = new HomePage();
            });
        }
Example #3
0
        public async Task SignOut()
        {
            // Based on:
            //  bitwarden-mobile\src\App\App.xaml.cs#LogOutAsync
            var userId = await _userService.GetUserIdAsync();

            await Task.WhenAll(
                _syncService.SetLastSyncAsync(DateTime.MinValue),
                _tokenService.ClearTokenAsync(),
                _cryptoService.ClearKeysAsync(),
                _userService.ClearAsync(),
                _settingsService.ClearAsync(userId),
                _cipherService.ClearAsync(userId),
                _folderService.ClearAsync(userId),
                _collectionService.ClearAsync(userId),
                _passwordGenerationService.ClearAsync(),
                _lockService.ClearAsync(),
                _stateService.PurgeAsync());

            _lockService.FingerprintLocked = true;
            _searchService.ClearIndex();
            //_authService.LogOut(() =>
            //{
            //    Current.MainPage = new HomePage();
            //    if (expired)
            //    {
            //        _platformUtilsService.ShowToast("warning", null, AppResources.LoginExpired);
            //    }
            //});
        }