Created
December 22, 2023 10:55
-
-
Save FacileTechnolab/83037ccc9486da1b84a54fb01c54ca8c to your computer and use it in GitHub Desktop.
Login and Logout links
This file contains 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
<!-- Add @using Microsoft.AspNetCore.Components.Authorization at the top--> | |
<CascadingAuthenticationState> | |
<AuthorizeView> | |
<Authorized> | |
<a asp-controller="Home" asp-action="Index">Welcome @context.User.Identity?.Name!</a> | |
<a href="MicrosoftIdentity/Account/SignOut">Logout</a> | |
</Authorized> | |
<NotAuthorized> | |
<a href="MicrosoftIdentity/Account/SignIn">Login</a> | |
</NotAuthorized> | |
</AuthorizeView> | |
</CascadingAuthenticationState> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment