Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
 public INetworkLayer Clone(RedditOAuth credential)
 {
     return(new NetworkLayer(new UserState {
         OAuth = credential
     }, _appId, _appSecret, _redirectUrl));
 }
Ejemplo n.º 3
0
 public INetworkLayer Clone(RedditOAuth credential)
 {
     return new NetworkLayer(new UserState { OAuth = credential }, _appId, _appSecret, _redirectUrl);
 }