Adjusting to use new extension methods to configure and handle token auth and oauth2

This commit is contained in:
Masu-Baumgartner
2024-11-06 16:46:24 +01:00
parent 288b0c8d97
commit f2d653563c
8 changed files with 63 additions and 330 deletions

View File

@@ -1,8 +1,6 @@
using Microsoft.AspNetCore.Components;
using MoonCore.Blazor.Helpers;
using Moonlight.Client.Interfaces;
using Moonlight.Client.Services;
using Moonlight.Client.UI.Screens;
namespace Moonlight.Client.Implementations;
@@ -11,18 +9,12 @@ public class AuthenticationUiHandler : IAppLoader, IAppScreen
public int Priority => 0;
public Task<bool> ShouldRender(IServiceProvider serviceProvider)
{
return Task.FromResult<bool>(false);
var identityService = serviceProvider.GetRequiredService<IdentityService>();
return Task.FromResult(!identityService.IsLoggedIn); // Only show the screen when we are not logged in
}
=> Task.FromResult(false);
public RenderFragment Render() => ComponentHelper.FromType<AuthenticationScreen>();
public RenderFragment Render() => throw new NotImplementedException();
public async Task Load(IServiceProvider serviceProvider)
{
return;
var identityService = serviceProvider.GetRequiredService<IdentityService>();
await identityService.Check();
}