private async Task RefreshUI()
        {
            YubiCryptOAuth2Token storedAccessToken = SettingsHelper.LoadSetting <YubiCryptOAuth2Token>(Consts.SETTINGS_ACCESS_TOKEN_KEY);

            if (CheckAccessToken(storedAccessToken))
            {
                client = new YubiCryptClient(clientId, clientSecret, storedAccessToken);
                if (!IsTokenSecretAvailable())
                {
                    await TokenSecretFirstTimeSetup();

                    return;
                }
                var secret = SettingsHelper.LoadSetting <TFTokenData>(Consts.SETTINGS_TOKEN_SECRET_KEY);
                await LoadFileListAsync();
            }
            else
            {
                await RenewAccessToken();
            }
        }
示例#2
0
 private async void DeleteKeyButton_Click(object sender, RoutedEventArgs e)
 {
     SettingsHelper.DeleteSetting(Consts.SETTINGS_TOKEN_SECRET_KEY);
     await LoadSettings();
 }
 private bool IsTokenSecretAvailable()
 {
     return(SettingsHelper.SettingsExists(Consts.SETTINGS_TOKEN_SECRET_KEY));
 }