I wrote my own identity attribute for MVC, but it has 1 flaw in it.
So when I create links to the users account, if they haven't logged in, the attribute catches it and redirects them to login.
In the attribute, I change the filter context to RedirectToRouteResult and send them to Login.
But after they login, they return to the original page and not the page I sent them to in the first place.
I guess I'm looking for a way to capture the original destination and pass it to the Login Page, so the controller can move them on their way to the proper destination.
I've seen Amazon do it in a query string. Any thoughts?
So this is a OnActionExecuting call
So when I create links to the users account, if they haven't logged in, the attribute catches it and redirects them to login.
In the attribute, I change the filter context to RedirectToRouteResult and send them to Login.
But after they login, they return to the original page and not the page I sent them to in the first place.
I guess I'm looking for a way to capture the original destination and pass it to the Login Page, so the controller can move them on their way to the proper destination.
I've seen Amazon do it in a query string. Any thoughts?
So this is a OnActionExecuting call
filterContext.Result = new RedirectToRouteResult(new RouteValueDictionary{ { "controller", "Account" }, { "action", "SignIn" } });
If it ain't broke don't fix it