Example #1
0
 public override AnswerItem Reply(MessageItem mItem)
 {
     return(new AnswerItem
     {
         Message = "You can enter to web-part here. Use this option in case of blocking Telegram.",
         Markup = new InlineKeyboardMarkup(new[]
         {
             new[]
             {
                 new InlineKeyboardButton
                 {
                     Text = "‍➜ Web-part login",
                     Url = _baseWebPath + _authSigner.GetAuthUrl(mItem.ChatId.ToString())
                 }
             },
         })
     });
 }
Example #2
0
        public void LoginUser(ApiUser apiUser)
        {
            var path     = _authSigner.GetAuthUrl(apiUser.Id);
            var response = ApiClient.CallApi(path, Method.GET);

            ApiClient.CheckResponse(response);

            var authCookie = response.Headers.FirstOrDefault(a => a.Name == "Set-Cookie");

            if (authCookie == null)
            {
                return;
            }

            if (ApiClient.RestClient.CookieContainer == null)
            {
                ApiClient.RestClient.CookieContainer = new CookieContainer();
            }

            ApiClient.RestClient.CookieContainer.SetCookies(new Uri(ApiClient.BasePath),
                                                            authCookie.Value.ToString());
        }