Beispiel #1
0
        // GET: Search
        public async Task <ActionResult> Index([Bind(Include = "q")] QuerySearchModel query)
        {
            if (!string.IsNullOrEmpty(User.Identity.Name))
            {
                if (_telegramService.IsIdentityRequired())
                {
                    var user = await UserManager.FindByNameAsync(User.Identity.Name);

                    if (user != null)
                    {
                        try
                        {
                            TempData["AuthHash"] = await _telegramService.AuthAsync(user.PhoneNumber);

                            return(RedirectToAction("CodeConfirm"));
                        }
                        catch { }
                    }
                }
            }
            return(View("Index", query));
        }