Browse Source

Revise the auth server UI

pull/870/head
Halil ibrahim Kalkan 7 years ago
parent
commit
87ac963a3e
  1. 44
      samples/MicroserviceDemo/applications/AuthServer.Host/Pages/Index.cshtml
  2. BIN
      samples/MicroserviceDemo/applications/AuthServer.Host/wwwroot/images/anonymous-user.png

44
samples/MicroserviceDemo/applications/AuthServer.Host/Pages/Index.cshtml

@ -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>
}

BIN
samples/MicroserviceDemo/applications/AuthServer.Host/wwwroot/images/anonymous-user.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Loading…
Cancel
Save