Created
May 1, 2020 18:18
-
-
Save manoj-choudhari-git/96b600f9a324684c1c022ef7d9eaa17c to your computer and use it in GitHub Desktop.
Login and Logout Links
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@if (User.Identity.IsAuthenticated) | |
{ | |
<li class="nav-item"> | |
<span class="navbar-text text-dark">Hello @User.Identity.Name!</span> | |
</li> | |
<li class="nav-item"> | |
<a class="nav-link text-dark" asp-area="MicrosoftIdentity" | |
asp-controller="Account" asp-action="SignOut"> | |
Sign out | |
</a> | |
</li> | |
} | |
else | |
{ | |
<li class="nav-item"> | |
<a class="nav-link text-dark" asp-area="MicrosoftIdentity" | |
asp-controller="Account" asp-action="SignIn"> | |
Sign in | |
</a> | |
</li> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment