Skip to content

Commit

Permalink
Displaying information about user identity
Browse files Browse the repository at this point in the history
  • Loading branch information
gorohoroh committed Jul 14, 2018
1 parent 170462e commit 8422014
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
16 changes: 16 additions & 0 deletions OdeToFoodRider/OdeToFoodRider/Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@
@RenderSection("footer", required: false)
@await Component.InvokeAsync("Greeter")
<vc:greeter></vc:greeter>
@if (User.Identity.IsAuthenticated)
{
foreach (var identity in User.Identities)
{
<h3>@identity.Name</h3>
<ul>
@foreach (var claim in identity.Claims)
{
<li>@claim.Type - @claim.Value</li>
}
</ul>
}
}
else {
<div>You are anonymous</div>
}
</footer>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,23 @@
@RenderSection("footer", required: false)
@await Component.InvokeAsync("Greeter")
<vc:greeter></vc:greeter>
@if(User.Identity.IsAuthenticated)
{
foreach (var identity in User.Identities)
{
<h3>@identity.Name</h3>
<ul>
@foreach (var claim in identity.Claims)
{
<li>@claim.Type - @claim.Value</li>
}
</ul>
}
}
@else
{
<div>You are anonymous</div>
}
</footer>
</body>
</html>

0 comments on commit 8422014

Please sign in to comment.