main
Last change
on this file was 2aea0fd, checked in by ElenaMoskova <elena.moskova99@…>, 4 months ago |
init commit Elena
|
-
Property mode
set to
100644
|
File size:
950 bytes
|
Rev | Line | |
---|
[2aea0fd] | 1 | @using Microsoft.AspNetCore.Identity
|
---|
| 2 | @inject SignInManager<IdentityUser> SignInManager
|
---|
| 3 | @inject UserManager<IdentityUser> UserManager
|
---|
| 4 |
|
---|
| 5 | <ul class="navbar-nav">
|
---|
| 6 | @if (SignInManager.IsSignedIn(User))
|
---|
| 7 | {
|
---|
| 8 | <li class="nav-item">
|
---|
| 9 | <a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Manage/Index" title="Manage">Hello @User.Identity?.Name!</a>
|
---|
| 10 | </li>
|
---|
| 11 | <li class="nav-item">
|
---|
| 12 | <form class="form-inline" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="@Url.Action("Index", "Home", new { area = "" })">
|
---|
| 13 | <button type="submit" class="nav-link btn-link text-dark">Logout</button>
|
---|
| 14 | </form>
|
---|
| 15 | </li>
|
---|
| 16 | }
|
---|
| 17 | else
|
---|
| 18 | {
|
---|
| 19 | <li class="nav-item">
|
---|
| 20 | <a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Register">Register</a>
|
---|
| 21 | </li>
|
---|
| 22 | <li class="nav-item">
|
---|
| 23 | <a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Login">Login</a>
|
---|
| 24 | </li>
|
---|
| 25 | }
|
---|
| 26 | </ul>
|
---|
Note:
See
TracBrowser
for help on using the repository browser.