public ActionResult Land(string id)
{
// "id" is the name of the identity source
// TODO: Refactor this into a Model Binder to reduce duplication
IdentitySource identitySource = GetIdentitySource(id);
if(identitySource == null) {
return ResourceNotFound();
}
identitySource.OnReturnFromProvider(ControllerContext);
Uri returnUrl = identitySource.GetReturnUrl(ControllerContext);
if (returnUrl == null) {
return new RedirectToRouteResult(new RouteValueDictionary(new {
page = (Page)null,
controller = DefaultControllerName,
action = DefaultActionName
}));
}
return new RedirectResult(returnUrl.ToString());
}