public async Task <IActionResult> Login(LoginViewModel loginVM) { var loggedUser = UsuarioLogeado.MapearUsuario(_usuarioLogic.Login(loginVM.NombreUsuario, loginVM.Clave)); if (loggedUser == null) { ModelState.AddModelError("", "Usuario o contraseña incorrectos"); return(View(loginVM)); } await _usuarioManager.SignIn(this.HttpContext, loggedUser, loginVM.IsPersistent); return(RedirectToAction(controllerName: "Home", actionName: "Index")); }