@inject AccountService AccountService @inject AuthenticationStateProvider AuthStateProvider @rendermode InteractiveServer @code { private List? accounts; protected override async Task OnInitializedAsync() { var authState = await AuthStateProvider.GetAuthenticationStateAsync(); var userId = authState.User.FindFirst(System.Security.Claims.ClaimTypes.NameIdentifier)?.Value; if (userId is not null) { accounts = await AccountService.GetAccountsAsync(userId); } } }