@inject CustomAuthenticationStateProvider AuthStateProvider;
Home
Statuslog
Home
Statuslog
@code {
private string? Name = null;
private List Addresses = new List();
private string FirstAddress { get => this.Addresses.FirstOrDefault() ?? string.Empty; }
protected override async Task OnInitializedAsync() {
var state = await AuthStateProvider.GetAuthenticationStateAsync();
var identity = state.User.Identity;
Name = identity?.Name ?? string.Empty;
Addresses = state.User.FindFirst("addresses")?.Value?.Split(',')?.ToList() ?? new List();
}
}