Chris Bass
07/03/2024, 7:23 PMjake williamson
07/03/2024, 9:55 PM[IsBackOffice]
[UmbracoUserTimeoutFilter]
[Authorize(Policy = AuthorizationPolicies.BackOfficeAccess)]
[DisableBrowserCache]
[UmbracoRequireHttps]
[MiddlewareFilter(typeof(UnhandledExceptionLoggerFilter))]
Chris Bass
07/08/2024, 1:26 PMjake williamson
07/08/2024, 10:33 PMIVirtualPageController
so we could do a custom route:
https://docs.umbraco.com/umbraco-cms/reference/routing/custom-routes#custom-route-with-ivirtualpagecontroller
our work around for the FindContent
part is:
public IPublishedContent FindContent(ActionExecutingContext actionExecutingContext)
{
//todo: this isn't ideal... but the controller needs to find a piece of content otherwise it won't find a route
var context = _umbracoContextAccessor.GetRequiredUmbracoContext();
return context.Content?.GetAtRoot().FirstOrDefault();
}
as you can see from the comment, we're relying on the fact there'll be at least one piece of content in the content tree... but in all instances for us there will be!Chris Bass
07/09/2024, 3:29 PMjake williamson
07/09/2024, 10:26 PM