@using System.Diagnostics
@using IdentityServer4.Extensions

@{
    var version =
            FileVersionInfo.GetVersionInfo(typeof(IdentityServer4.Hosting.IdentityServerMiddleware).Assembly.Location).ProductVersion.Split('+').First();
}

<div class="welcome-page">
    <div class="row justify-content-center align-items-center">
        <div class="col-lg-6 col-md-8">
            <div class="card p-5 justify-content-center">
                @if (User.Identity.IsAuthenticated)
                {
                    <h2 class="font-weight-normal">
                        Welcome @User.GetDisplayName()!
                    </h2>
                    <p class="mt-2">Your UPN is: @User.FindFirst("sub").Value</p>
                    <div>
                        <a class="btn btn-primary px-4 font-weight-bold mt-4" asp-controller="Account" asp-action="Logout"
                            role="button">Logout</a>
                    </div>
                }
                else
                {
                    <h2 class="font-weight-normal">
                        Identity Server
                    </h2>

                    <p class="font-weight-light mt-4" style="font-size: 20px;">This service is a centeralized
                        authentication tool. It's used
                        for
                        all of the kurdistan's digital
                        services.
                    </p>
                    <div>
                        <a class="btn btn-primary px-4 font-weight-bold mt-4" asp-controller="Account" asp-action="Login"
                            role="button">Login</a>
                    </div>
                }
            </div>
        </div>
    </div>
</div>
