<ul class="navbar-nav">
    @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-controller="Home" asp-action="SignOut">Sign out</a>
        </li>
    }
    else
    {
        <li class="nav-item">
            <a class="nav-link text-dark" asp-controller="Home" asp-action="SignIn">Sign in</a>
        </li>
    }
</ul>
