initial commit

This commit is contained in:
2026-07-21 14:22:06 +07:00
commit 2d7959f202
572 changed files with 45295 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
using Indotalent.ConfigFrontEnd.Extensions;
using Indotalent.ConfigFrontEnd.Models;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Authorization;
namespace Indotalent.ConfigFrontEnd.Common;
public abstract class BaseAppPage : ComponentBase
{
[Inject]
protected AuthenticationStateProvider AuthStateProvider { get; set; } = default!;
[Inject]
protected CurrentUserState State { get; set; } = default!;
protected override async Task OnParametersSetAsync()
{
await SyncUserContext();
await base.OnParametersSetAsync();
}
private async Task SyncUserContext()
{
var authState = await AuthStateProvider.GetAuthenticationStateAsync();
var user = authState.User;
if (user.Identity?.IsAuthenticated == true)
{
State.UserId = user.GetUserId();
State.UserName = user.GetUserName();
State.Email = user.GetEmail();
State.FullName = user.GetFullName();
State.TenantId = user.GetTenantId();
}
}
}