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