Aggiunta login

This commit is contained in:
2025-05-09 14:43:46 +02:00
parent ea52494dfb
commit eb1dc8daa2
22 changed files with 440 additions and 534 deletions

View File

@@ -1,28 +1,29 @@
using IntegryApiClient.Blazor;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using MudBlazor.Services;
using Template.Shared.Components;
using Template.Shared.Core.Services;
using Template.Shared.Interfaces;
using Template.Web.Services;
#if DEBUG
const string BaseRestServicesEndpoint = "https://devservices.studioml.it/ems-api/";
//const string BaseRestServicesEndpoint = "http://192.168.2.23:8080/ems-api/";
#else
const string BaseRestServicesEndpoint = "https://services.studioml.it/ems-api/";
#endif
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.Services.AddMudServices();
builder.Services.AddAuthorizationCore();
builder.Services.UseIntegry(BaseRestServicesEndpoint);
builder.Services.AddScoped<IFormFactor, FormFactor>();
builder.Services.AddScoped<AppAuthenticationStateProvider>();
builder.Services.AddScoped<AuthenticationStateProvider>(provider => provider.GetRequiredService<AppAuthenticationStateProvider>());
builder.Services.UseLoginAzienda("f0484398-1f8b-42f5-ab79-5282c164e1d8");
builder.RootComponents.Add<Routes>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
await builder.Build().RunAsync();
builder.Services.AddScoped(_ => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
var host = builder.Build();
await host.RunAsync();