This is a Blazor Wasm app from a VS2019 template with Authentication/Authorization.
I need to know who the user is that is logged in.
User = HttpContextAccessor.HttpContext.User.Identity.Name;
HttpContextAccessor has a squiggle with cannot be found complaint.
My page has:
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication
@using System.Security.Claims
@attribute [Authorize]
@inject HttpClient http
@inject NavigationManager navManager
@inject ISnackbar Snackbar
@inject IDialogService DialogService
@inject IHttpContextAccessor HttpContextAccessor
Program.Main in the Client project has:
builder.Services.AddHttpContextAccessor();
What am I doing wrong here?