예제 #1
0
        private async Task HandleVaultTimeoutAsync()
        {
            if (await _vaultTimeoutService.IsLockedAsync())
            {
                return;
            }
            var authed = await _userService.IsAuthenticatedAsync();

            if (!authed)
            {
                return;
            }
            var vaultTimeout = await _storageService.GetAsync <int?>(Constants.VaultTimeoutKey);

            vaultTimeout = vaultTimeout.GetValueOrDefault(-1);
            if (vaultTimeout == 0)
            {
                var action = await _storageService.GetAsync <string>(Constants.VaultTimeoutActionKey);

                if (action == "logOut")
                {
                    await _vaultTimeoutService.LogOutAsync();
                }
                else
                {
                    await _vaultTimeoutService.LockAsync(true);
                }
            }
        }
예제 #2
0
        private async Task HandleVaultTimeoutAsync()
        {
            if (await _vaultTimeoutService.IsLockedAsync())
            {
                return;
            }
            var authed = await _userService.IsAuthenticatedAsync();

            if (!authed)
            {
                return;
            }
            // Will only ever be null - look to remove this in the future
            var vaultTimeout = _platformUtilsService.LockTimeout();

            if (vaultTimeout == null)
            {
                vaultTimeout = await _storageService.GetAsync <int?>(Constants.VaultTimeoutKey);
            }
            vaultTimeout = vaultTimeout.GetValueOrDefault(-1);
            if (vaultTimeout == 0)
            {
                var action = await _storageService.GetAsync <string>(Constants.VaultTimeoutActionKey);

                if (action == "logOut")
                {
                    await _vaultTimeoutService.LogOutAsync();
                }
                else
                {
                    await _vaultTimeoutService.LockAsync(true);
                }
            }
        }