public async Task <IActionResult> Index(Entities.Models.Login model) { if (ModelState.IsValid) { AuthRetorno retorno = client.ValidaLoginUsuario(new LoginRequisitor(model.usuario, model.senha)); if (retorno.authenticated) { await HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, new ClaimsPrincipal(retorno.Claims), new AuthenticationProperties { IsPersistent = true, ExpiresUtc = DateTime.UtcNow.AddMinutes(10) }); return(RedirectToAction(nameof(DashboardController.Index), "Dashboard")); } else { ModelState.AddModelError("usuario", retorno.message); } } return(View(model)); }