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(); } }
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)); }