public async Task<bool> AccessTokenIsFresh(OAuthToken accessToken) { try { if (!_networkService.IsAvailable || accessToken == null) return false; var token = await Tokens.WithToken(accessToken.Key); return token != null; } catch (TrelloUnauthorizedException) { return false; } catch (TrelloException) { return false; } catch (Exception) { return false; } }
public void Authorize(OAuthToken accessToken) { _client.Authorize(accessToken); }
private async void AccessGranted(OAuthToken token) { _settings.AccessToken = token; var profile = await _api.Members.Me(); if (profile != null) { _settings.MemberId = profile.Id; _settings.Username = profile.Username; _settings.Fullname = profile.FullName; _settings.AvatarHash = profile.AvatarHash; } UsingView(view => view.Browser.Visibility = Visibility.Collapsed); _navigationService.UriFor<ShellViewModel>().Navigate(); }