TheInfinityIQ_GCP/src/gcp-backend/GCP.Api/Pages/Shared/_LoginPartial.cshtml
@using Microsoft.AspNetCore.Identity
@using GCP.Api.Data.Entities
@inject SignInManager<User> SignInManager
@inject UserManager<User> UserManager
@{
    var isSignedIn = SignInManager.IsSignedIn(User);
    User? user = null;
    if (isSignedIn)
    {
        user = await UserManager.GetUserAsync(User);
    }
}


<ul class="navbar-nav">
    @if (isSignedIn)
    {
        <li class="nav-item">
            <a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Manage/Index" title="Manage">Hello @(user!.DisplayName)!</a>
        </li>
        <li class="nav-item">
            <form class="form-inline" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="@Url.Page("/", new { area = "" })" method="post">
                <button type="submit" class="nav-link btn btn-link text-dark">Logout</button>
            </form>
        </li>
    }
    else
    {
        <li class="nav-item">
            <a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Register">Register</a>
        </li>
        <li class="nav-item">
            <a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Login">Login</a>
        </li>
    }
</ul>
