You're going nothing with the ReturnUrl param in the HttpGet. In order for that to be available in the HttpPost you'll need to store it in the form.
Amend the LoginViewModel class to add a ReturnUrl property
public string ReturnUrl { get; set; }
Capture the url in the HttpGet method and ensure it is included in the form
public ActionResult Login(string returnUrl)
{
LoginViewModel model = new LoginViewModel();
model.ReturnUrl = returnUrl;
return View(model);
}
[HttpPost]
public ActionResult Login(LoginViewModel model)
{
return View(model);
}
@model LoginViewModel
@using (Html.BeginForm())
{
@Html.HiddenFor(m => m.ReturnUrl)
<input type="submit" value="Login"/>
}