You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We’ve got the UmbracoIdentity package installed and we are looking to style the ExternalLoginFailure view. However, we can’t figure out how to get the current site reference into the request pipeline. Ideally, we would like to be able to use the master template that the site uses and have the same navigation driven by Umbraco Content, but when we try to get the Umbraco root node of the site our rendering breaks with the following error: Cannot return the IPublishedContent because the UmbracoHelper was not constructed with an IPublishedContent..
The ExternalLoginFailure view is called from the ExteralLoginCallback method and from the ExternalLoginFailure method. The Latter of which we are using as a test call and have modified it as follows:
public ActionResult ExternalLoginFailure(string returnUrl = null)
{
IPublishedContent node = UmbracoContext.Content.GetByRoute(returnUrl.IfNullOrWhiteSpace("/"));
if(node != null)
{
var siteRoot = node.Root();
var loginFailureDetails = siteRoot.FirstChildOfType(LoginFailure.ModelTypeAlias);
if (loginFailureDetails != null)
node = loginFailureDetails;
}
return View("ExternalLoginFailure", node);
}
Fundamentally, the question we have is:
How can we incorporate our site properly into the views returned back from this controller to ensure we have consistent branding etc without having to duplicate lost of html/render code?
Thanks
The text was updated successfully, but these errors were encountered:
Hi Shannon,
We’ve got the UmbracoIdentity package installed and we are looking to style the ExternalLoginFailure view. However, we can’t figure out how to get the current site reference into the request pipeline. Ideally, we would like to be able to use the master template that the site uses and have the same navigation driven by Umbraco Content, but when we try to get the Umbraco root node of the site our rendering breaks with the following error:
Cannot return the IPublishedContent because the UmbracoHelper was not constructed with an IPublishedContent.
.The ExternalLoginFailure view is called from the ExteralLoginCallback method and from the ExternalLoginFailure method. The Latter of which we are using as a test call and have modified it as follows:
Fundamentally, the question we have is:
How can we incorporate our site properly into the views returned back from this controller to ensure we have consistent branding etc without having to duplicate lost of html/render code?
Thanks
The text was updated successfully, but these errors were encountered: