public ActionResult Login(LoginViewModel login, string returnUrl) { if (!ModelState.IsValid) { return(View(login)); } var achou = (UsuarioViewModel.ValidaUsuario(login.Usuario, login.Senha)); if (achou) { FormsAuthentication.SetAuthCookie(login.Usuario, login.LembrarMe); if (Url.IsLocalUrl(returnUrl)) { returnUrl = "/Cadastrar/Livro"; return(Redirect(returnUrl)); } else { return(RedirectToAction("Index", "Home")); } } else { ModelState.AddModelError("", "Login inválido!"); } return(View(login)); }