LANCommander/LANCommander.Server/UI/Shared/BasicLayout.razor
2024-08-04 18:44:33 -05:00

26 lines
No EOL
707 B
Text

@inherits LayoutComponentBase
@using Microsoft.AspNetCore.Components.Authorization;
@using System.Security.Claims;
@inject AuthenticationStateProvider AuthenticationStateProvider
<Layout Class="layout">
<Content Style="padding: 24px;">
@Body
</Content>
<Footer Style="text-align: center; padding-top: 0;">
LANCommander v@(UpdateService.GetCurrentVersion().ToString())
</Footer>
</Layout>
@code {
ClaimsPrincipal User;
protected override async Task OnInitializedAsync()
{
var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync();
if (authState.User.Identity.IsAuthenticated)
User = authState.User;
}
}