public override void OnAuthorization(AuthorizationContext filterContext)
{
base.OnAuthorization(filterContext);
if(filterContext.Result is HttpUnauthorizedResult)
{
var rvd = new RouteValueDictionary();
rvd.Add("uniqueName", filterContext.RouteData.Values["uniqueName"].ToString());
rvd.Add("controller", "Account");
rvd.Add("action", "Login");
rvd.Add("id", null);
rvd.Add("RetrunUrl", filterContext.HttpContext.Request.RawUrl);
filterContext.Result = new RedirectToRouteResult(rvd);
}
}