This commit is contained in:
parent
36a651e29a
commit
e043f9317f
|
|
@ -1,8 +1,9 @@
|
|||
@page
|
||||
@using Microsoft.AspNetCore.Identity
|
||||
@attribute [IgnoreAntiforgeryToken]
|
||||
@inject SignInManager<IdentityUser> SignInManager
|
||||
@functions {
|
||||
public async Task<IActionResult> OnGet()
|
||||
public async Task<IActionResult> OnPost()
|
||||
{
|
||||
if (SignInManager.IsSignedIn(User))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
<AuthorizeView>
|
||||
<Authorized>
|
||||
<a href="Identity/Account/Manage">Hello, @context.User.Identity.Name!</a>
|
||||
<a href="Identity/Account/LogOut">Log out</a>
|
||||
<form method="post" action="Identity/Account/LogOut">
|
||||
<button type="submit" class="nav-link btn btn-link">Log out</button>
|
||||
</form>
|
||||
</Authorized>
|
||||
<NotAuthorized>
|
||||
<a href="Identity/Account/Register">Register</a>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ html, body {
|
|||
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
}
|
||||
|
||||
a {
|
||||
a, .btn-link {
|
||||
color: #0366d6;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue