Skip to content

Instantly share code, notes, and snippets.

@peleyal
Last active August 29, 2015 14:09
Show Gist options
  • Save peleyal/ab011e474008203cc037 to your computer and use it in GitHub Desktop.
Save peleyal/ab011e474008203cc037 to your computer and use it in GitHub Desktop.
/// <summary>
/// Continues the app after retrieving the authorization code.
///
/// First it stores the authorization code result in the data store.
/// Then it calls the view model get blogs method, in order to retrieve all blogs.
/// The view model is responsible to check for if the authorization code exists in
/// the data store, and then, continue with the regular flow.
/// After retrieving all blogs, this method deletes the authorization code so it
/// won't be used in a next run.
/// </summary>
public async void ContinueWebAuthentication(
WebAuthenticationBrokerContinuationEventArgs args)
{
await PasswordVaultDataStore.Default.StoreAsync<WebAuthResult>(
WebAuthResult.Name, new WebAuthResult(args.WebAuthenticationResult));
await ((BlogsViewModel)this.DataContext).GetBlogsAsync();
await PasswordVaultDataStore.Default.DeleteAsync<WebAuthResult>(WebAuthResult.Name);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment