Improved jwt handling for node access tokens. Switched to di plugin system

This commit is contained in:
2025-02-24 21:03:23 +01:00
parent 67efe71247
commit a8d867c3c7
11 changed files with 101 additions and 48 deletions

View File

@@ -1,28 +1,24 @@
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using MoonCore.Extensions;
using MoonCore.PluginFramework.Extensions;
using Moonlight.Client.Interfaces;
using MoonlightServers.Frontend.Implementations;
using MoonlightServers.Frontend.Interfaces;
namespace MoonlightServers.Frontend.Startup;
public class PluginStartup : IAppStartup
public class PluginStartup : IPluginStartup
{
public Task BuildApp(WebAssemblyHostBuilder builder)
public Task BuildApplication(WebAssemblyHostBuilder builder)
{
builder.Services.AddSingleton<ISidebarItemProvider, SidebarImplementation>();
builder.Services.AddSingleton<IServerTabProvider, DefaultServerTabProvider>();
builder.Services.AutoAddServices<PluginStartup>();
builder.Services.AddInterfaces(configuration =>
{
configuration.AddAssembly(GetType().Assembly);
configuration.AddInterface<IServerTabProvider>();
});
return Task.CompletedTask;
}
public Task ConfigureApp(WebAssemblyHost app)
public Task ConfigureApplication(WebAssemblyHost app)
{
return Task.CompletedTask;
}

View File

@@ -12,7 +12,7 @@
@using MoonlightServers.Frontend.UI.Components.Servers.ServerTabs
@inject HttpApiClient ApiClient
@inject IServerTabProvider[] TabProviders
@inject IEnumerable<IServerTabProvider> TabProviders
@implements IAsyncDisposable