|
|
|
@ -1,8 +1,10 @@ |
|
|
|
@page "/" |
|
|
|
@using Volo.Abp.Users |
|
|
|
@using Volo.Abp.MultiTenancy |
|
|
|
@using System.Security.Claims |
|
|
|
@inject ICurrentUser CurrentUser |
|
|
|
@inject ICurrentTenant CurrentTenant |
|
|
|
@inject AuthenticationStateProvider AuthenticationStateProvider |
|
|
|
|
|
|
|
<h1>Welcome to MyProjectName!</h1> |
|
|
|
|
|
|
|
@ -23,6 +25,17 @@ |
|
|
|
</ul> |
|
|
|
} |
|
|
|
|
|
|
|
@if (_claims != null) |
|
|
|
{ |
|
|
|
<h3>Current Claims</h3> |
|
|
|
<ul> |
|
|
|
@foreach (var claim in _claims) |
|
|
|
{ |
|
|
|
<li>@claim.Type: @claim.Value</li> |
|
|
|
} |
|
|
|
</ul> |
|
|
|
} |
|
|
|
|
|
|
|
@if (CurrentTenant.IsAvailable) |
|
|
|
{ |
|
|
|
<h3>Current Tenant</h3> |
|
|
|
@ -31,3 +44,17 @@ |
|
|
|
<li>Name: <strong>@CurrentTenant.Name</strong></li> |
|
|
|
</ul> |
|
|
|
} |
|
|
|
|
|
|
|
@code |
|
|
|
{ |
|
|
|
private IEnumerable<Claim> _claims; |
|
|
|
|
|
|
|
protected override async Task OnInitializedAsync() |
|
|
|
{ |
|
|
|
var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync(); |
|
|
|
if (authState.User.Identity.IsAuthenticated) |
|
|
|
{ |
|
|
|
_claims = authState.User.Claims; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|