This is related to #354, however I am not able to use synchronous code here without duplicating the logic for the authorization. Specifically we are using policy based authorization using IAuthorizationService which only provides an async method. We are having to force the execution to be synchronous (which is working fine because behind the scenes there really isnt anything that requires the call to be async).
services
.AddMiniProfiler(x =>
{
x.ResultsAuthorize = request => request.HttpContext.RequestServices.GetRequiredService<IAuthorizationService>().AuthorizeAsync(request.HttpContext.User, "CanProfile").Result.Succeeded;
});
This is related to #354, however I am not able to use synchronous code here without duplicating the logic for the authorization. Specifically we are using policy based authorization using
IAuthorizationServicewhich only provides an async method. We are having to force the execution to be synchronous (which is working fine because behind the scenes there really isnt anything that requires the call to be async).