Adjusting to use new extension methods to configure and handle token auth and oauth2
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user