public dynamic AuthorizationCode()
        {
            var result = _client.AuthorizationCode(_account.Code);

            if (result.StatusCode == HttpStatusCode.OK && result.Data != null)
            {
                _buttery.Save(_account, result.Data);

                return(new {
                    Account = _account
                });
            }

            throw new ApiError()
                  {
                      StatusCode = result.StatusCode, ErrorMessage = result.ErrorMessage, Content = result.Content
                  };
        }
Esempio n. 2
0
        public RedirectToActionResult Code(string code)
        {
            // PRG back to home
            // step 2: use code to get auth token
            // http://localhost:5001/home/code?state=&code={sha1}&scope=read,activity:write,activity:read_all

            _account.Code = code;
            _buttery.Save(_account);

            return(RedirectToAction("Index"));
        }