|
|
|
@ -2,22 +2,38 @@ |
|
|
|
@using Volo.Abp.Users |
|
|
|
@model AuthServer.Host.Pages.IndexModel |
|
|
|
@inject ICurrentUser CurrentUser |
|
|
|
<h1>Running the <strong>AuthServer.Host</strong> application!</h1> |
|
|
|
<h2>Current User</h2> |
|
|
|
<ul> |
|
|
|
<li>IsAuthenticated: @CurrentUser.IsAuthenticated</li> |
|
|
|
<li>UserName: @CurrentUser.UserName</li> |
|
|
|
<li>Email: @CurrentUser.Email</li> |
|
|
|
<li>Roles: @CurrentUser.Roles.JoinAsString(", ")</li> |
|
|
|
@*<li>Claims: @CurrentUser.GetAllClaims().Select(c => $"{c.Type}={c.Value}").JoinAsString(" | ")</li>*@ |
|
|
|
<li>TenantId: @CurrentUser.TenantId</li> |
|
|
|
</ul> |
|
|
|
|
|
|
|
@section styles { |
|
|
|
<style> |
|
|
|
.online-user-info { |
|
|
|
} |
|
|
|
</style> |
|
|
|
} |
|
|
|
@if (CurrentUser.IsAuthenticated) |
|
|
|
{ |
|
|
|
<a abp-button="Primary" asp-controller="Logout" asp-action="Index" asp-area="Account">Logout</a> |
|
|
|
<div class="online-user-info"> |
|
|
|
<abp-row> |
|
|
|
<abp-column size-md="_3" class="text-center"> |
|
|
|
<i class="fa fa-user d-block" style="font-size: 10em; color: #12b900"></i> |
|
|
|
<a abp-button="Primary" asp-controller="Logout" asp-action="Index" asp-area="Account">Logout</a> |
|
|
|
</abp-column> |
|
|
|
<abp-column size-md="_9"> |
|
|
|
<h2>@CurrentUser.UserName</h2> |
|
|
|
<h5 class="text-muted">@CurrentUser.Email</h5> |
|
|
|
<div> |
|
|
|
<strong>Roles</strong>: @CurrentUser.Roles.JoinAsString(", ") |
|
|
|
<br /> |
|
|
|
<strong>Claims</strong>: <br /> |
|
|
|
@Html.Raw(CurrentUser.GetAllClaims().Select(c => $"{c.Type}={c.Value}").JoinAsString(" <br /> ")) |
|
|
|
</div> |
|
|
|
</abp-column> |
|
|
|
</abp-row> |
|
|
|
</div> |
|
|
|
} |
|
|
|
else |
|
|
|
|
|
|
|
@if (!CurrentUser.IsAuthenticated) |
|
|
|
{ |
|
|
|
<a abp-button="Primary" asp-page="/Account/Login">Login</a> |
|
|
|
<div class="text-center"> |
|
|
|
<img src="~/images/anonymous-user.png" width="200" /><br/><br /> |
|
|
|
<a abp-button="Primary" asp-page="/Account/Login">Login</a> |
|
|
|
</div> |
|
|
|
} |