1
0
mirror of synced 2024-12-01 01:27:21 +01:00
TaikoLocalServer/TaikoWebUI/Pages/Users.razor.cs

20 lines
508 B
C#

namespace TaikoWebUI.Pages;
public partial class Users
{
private List<User>? users;
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
if (AuthService.LoginRequired && !AuthService.IsLoggedIn)
{
await AuthService.LoginWithAuthToken();
}
if (AuthService.IsAdmin || !AuthService.LoginRequired)
{
users = await Client.GetFromJsonAsync<List<User>>("api/Users");
}
}
}