LANCommander/LANCommander.Server/UI/Shared/BasicLayout.razor

26 lines
707 B
Text
Raw Normal View History

@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;
}
}