Added CORS, added specific type for token in AuthToken.cs, added login page to blazor client

This commit is contained in:
2024-08-30 15:10:25 +03:00
parent c631dc99d0
commit 802e42563e
15 changed files with 102 additions and 36 deletions

View File

@@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using VisaApiClient;
namespace BlazorWebAssemblyVisaApiClient;
@@ -11,7 +12,13 @@ public class Program
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
//todo move to launch settings
const string baseAddress = "https://localhost:44370";
//todo make pretty
builder.Services.AddScoped(_ => new HttpClient { BaseAddress = new Uri(baseAddress) });
builder.Services.AddScoped<Client>(sp =>
new Client(baseAddress, sp.GetRequiredService<HttpClient>()));
await builder.Build().RunAsync();
}