@{
    ViewData["Title"] = "Home Page";
}

<div class="jumbotron">
    @if (User?.Identity?.IsAuthenticated ?? false) {
        <h1>Welcome, @User.Identity.Name</h1>

        <p>
            @foreach (var claim in Context.User.Claims) {
                <div>@claim.Type: <b>@claim.Value</b></div>
            }
        </p>

        if (!string.IsNullOrEmpty(Model)) {
            <h3>Message received from the resource controller: @Model</h3>
        }

        <form action="~/Home/GetUserInfo" method="post">
            <button class="btn btn-lg btn-warning" type="submit">Get user info</button>
        </form>
        <form action="~/Home/PostDeviceInfo" method="post">
            <button class="btn btn-lg btn-warning" type="submit">Post device info</button>
        </form>

        <a class="btn btn-lg btn-danger" href="/signout">Sign out</a>
    }

    else {
        <h1>Welcome, anonymous</h1>
        <a class="btn btn-lg btn-success" href="/signin">Sign in</a>
    }
</div>
