Exemple #1
0
        //this one is seperated out so we can use it interally on initial user login
        public async Task <Account> ChangeIdentity(RedditOAuth oAuth)
        {
            var authedLayer   = _networkLayer.Clone(oAuth);
            var authedAccount = JsonConvert.DeserializeObject <Account>(await authedLayer.Get("/api/v1/me", CancellationToken.None, new Progress <float>(), null));

            _networkLayer = authedLayer;
            _userState    = new UserState {
                OAuth = oAuth, Username = authedAccount.Name, IsGold = authedAccount.IsGold, IsMod = authedAccount.IsMod, ModHash = authedAccount.ModHash
            };
            return(authedAccount);
        }
Exemple #2
0
 public INetworkLayer Clone(RedditOAuth credential)
 {
     return(new NetworkLayer(new UserState {
         OAuth = credential
     }, _appId, _appSecret, _redirectUrl));
 }
 public INetworkLayer Clone(RedditOAuth credential)
 {
     return new NetworkLayer(new UserState { OAuth = credential }, _appId, _appSecret, _redirectUrl);
 }