diff --git a/apps/auth-server/src/EShopOnAbp.AuthServer/Pages/Index.cshtml b/apps/auth-server/src/EShopOnAbp.AuthServer/Pages/Index.cshtml new file mode 100644 index 00000000..34688fb3 --- /dev/null +++ b/apps/auth-server/src/EShopOnAbp.AuthServer/Pages/Index.cshtml @@ -0,0 +1,27 @@ +@page +@using Microsoft.AspNetCore.Mvc.Localization +@using EShopOnAbp.Localization +@using EShopOnAbp.AuthServer.Pages +@using Volo.Abp.Users +@model IndexModel +@inject IHtmlLocalizer L +@inject ICurrentUser CurrentUser +
+ + + + @* ReSharper disable once Mvc.ControllerNotResolved *@ + @L["Logout"] + + +

@CurrentUser.UserName

+
@CurrentUser.Email
+
+ Roles: @CurrentUser.Roles.JoinAsString(", ") +
+ Claims:
+ @Html.Raw(CurrentUser.GetAllClaims().Select(c => $"{c.Type}={c.Value}").JoinAsString("
")) +
+
+
+
\ No newline at end of file diff --git a/apps/auth-server/src/EShopOnAbp.AuthServer/Pages/Index.cshtml.cs b/apps/auth-server/src/EShopOnAbp.AuthServer/Pages/Index.cshtml.cs new file mode 100644 index 00000000..29fe87d3 --- /dev/null +++ b/apps/auth-server/src/EShopOnAbp.AuthServer/Pages/Index.cshtml.cs @@ -0,0 +1,20 @@ +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; + +namespace EShopOnAbp.AuthServer.Pages +{ + public class IndexModel : AbpPageModel + { + public ActionResult OnGet() + { + if (!CurrentUser.IsAuthenticated) + { + return Redirect("~/Account/Login"); + } + else + { + return Page(); + } + } + } +} diff --git a/apps/auth-server/src/EShopOnAbp.AuthServer/Pages/_ViewImports.cshtml b/apps/auth-server/src/EShopOnAbp.AuthServer/Pages/_ViewImports.cshtml new file mode 100644 index 00000000..c1da1f5f --- /dev/null +++ b/apps/auth-server/src/EShopOnAbp.AuthServer/Pages/_ViewImports.cshtml @@ -0,0 +1,4 @@ +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling \ No newline at end of file