public async Task <IActionResult> Login(UserLogin userLogin, string returnUrl = null) { ViewData["ReturnUrl"] = returnUrl; if (!ModelState.IsValid) { return(View(userLogin)); } var response = await _authenticatorService.Login(userLogin); if (HasErrorsResponse(response.ResponseResult)) { return(View(userLogin)); } await RealizaLogin(response); if (string.IsNullOrEmpty(returnUrl)) { return(RedirectToAction("Index", "Catalog")); } return(LocalRedirect(returnUrl)); }