Aggiunta login
This commit is contained in:
@@ -1,20 +1,17 @@
|
||||
using IntegryApiClient.MAUI;
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MudBlazor.Services;
|
||||
using Template.Maui.Services;
|
||||
using Template.Shared;
|
||||
using Template.Shared.Core.Services;
|
||||
using Template.Shared.Interfaces;
|
||||
|
||||
namespace Template.Maui
|
||||
{
|
||||
public static class MauiProgram
|
||||
{
|
||||
#if DEBUG
|
||||
private const string BaseRestServicesEndpoint = "https://devservices.studioml.it/ems-api/";
|
||||
//private const string BaseRestServicesEndpoint = "http://192.168.2.23:8080/ems-api/";
|
||||
#else
|
||||
private const string BaseRestServicesEndpoint = "https://services.studioml.it/ems-api/";
|
||||
#endif
|
||||
private const string AppToken = "f0484398-1f8b-42f5-ab79-5282c164e1d8";
|
||||
|
||||
public static MauiApp CreateMauiApp()
|
||||
{
|
||||
@@ -23,7 +20,7 @@ namespace Template.Maui
|
||||
var builder = MauiApp.CreateBuilder();
|
||||
builder
|
||||
.UseMauiApp<App>()
|
||||
.UseIntegry(BaseRestServicesEndpoint)
|
||||
.UseLoginAzienda(AppToken)
|
||||
.ConfigureFonts(fonts =>
|
||||
{
|
||||
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
|
||||
@@ -32,6 +29,11 @@ namespace Template.Maui
|
||||
builder.Services.AddMauiBlazorWebView();
|
||||
builder.Services.AddMudServices();
|
||||
|
||||
builder.Services.AddAuthorizationCore();
|
||||
builder.Services.AddScoped<AppAuthenticationStateProvider>();
|
||||
builder.Services.AddScoped<AuthenticationStateProvider>(provider =>
|
||||
provider.GetRequiredService<AppAuthenticationStateProvider>());
|
||||
|
||||
#if DEBUG
|
||||
builder.Services.AddBlazorWebViewDeveloperTools();
|
||||
builder.Logging.AddDebug();
|
||||
|
||||
Reference in New Issue
Block a user