Starting updating mooncore dependency usage
This commit is contained in:
@@ -1,14 +1,26 @@
|
||||
@page "/"
|
||||
|
||||
@using Moonlight.Client.Services
|
||||
|
||||
@inject IdentityService IdentityService
|
||||
@using Microsoft.AspNetCore.Components.Authorization
|
||||
|
||||
<div class="font-medium leading-[1.1] tracking-tight">
|
||||
<div class="animate-shimmer bg-gradient-to-r from-violet-400 via-sky-400 to-purple-400 bg-clip-text font-semibold text-transparent text-3xl" style="animation-duration: 5s; background-size: 200% 100%">
|
||||
Welcome, @(IdentityService.Username)
|
||||
Welcome, @(Username)
|
||||
</div>
|
||||
<div class="text-gray-200 text-2xl">What do you want to do today?</div>
|
||||
</div>
|
||||
|
||||
<div class="text-primary-500/10"></div>
|
||||
<div class="text-primary-500/10"></div>
|
||||
|
||||
@code
|
||||
{
|
||||
[CascadingParameter] public Task<AuthenticationState> AuthState { get; set; }
|
||||
|
||||
private string Username;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
var identity = await AuthState;
|
||||
var usernameClaim = identity.User.Claims.ToArray().First(x => x.Type == "username");
|
||||
Username = usernameClaim.Value;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user