Updated MoonCore dependencies. Switched to asp.net core native authentication scheme abstractions. Updated claim usage in frontend
This commit is contained in:
@@ -25,27 +25,11 @@ public partial class Startup
|
||||
WebAssemblyHostBuilder.Services.AddScoped(sp =>
|
||||
{
|
||||
var httpClient = sp.GetRequiredService<HttpClient>();
|
||||
var httpApiClient = new HttpApiClient(httpClient);
|
||||
|
||||
var localStorageService = sp.GetRequiredService<LocalStorageService>();
|
||||
|
||||
httpApiClient.OnConfigureRequest += async request =>
|
||||
{
|
||||
var accessToken = await localStorageService.GetString("AccessToken");
|
||||
|
||||
if (string.IsNullOrEmpty(accessToken))
|
||||
return;
|
||||
|
||||
request.Headers.Add("Authorization", $"Bearer {accessToken}");
|
||||
};
|
||||
|
||||
return httpApiClient;
|
||||
return new HttpApiClient(httpClient);
|
||||
});
|
||||
|
||||
WebAssemblyHostBuilder.Services.AddScoped<WindowService>();
|
||||
WebAssemblyHostBuilder.Services.AddFileManagerOperations();
|
||||
WebAssemblyHostBuilder.Services.AddFlyonUiServices();
|
||||
WebAssemblyHostBuilder.Services.AddScoped<LocalStorageService>();
|
||||
|
||||
WebAssemblyHostBuilder.Services.AddScoped<ThemeService>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user