csharpfritz / BlazingPizzaWorkshop

The Blazing Pizza Workshop, updated for .NET 8
MIT License
35 stars 19 forks source link

Error on Place Order #1

Open mmisu opened 5 months ago

mmisu commented 5 months ago

blazor.web.js:1 [2024-04-10T22:11:05.794Z] Error: There was an unhandled exception on the current circuit, so this circuit will be terminated. For more details turn on detailed exceptions by setting 'DetailedErrors: true' in 'appSettings.Development.json' or set 'CircuitOptions.DetailedErrors'.

DaniNogy commented 5 months ago

In OrderDetails , OnParametersSetAsync , add a verification for null httpcontext:

if(HttpContext !=null)
{
    var userId= HttpContext.User.FindFirstValue(ClaimTypes.NameIdentifier);
    orderWithStatus = await Repository.GetOrderWithStatus(OrderId, userId);

}