using Microsoft.AspNetCore.Authentication.Cookies; using MudBlazor.Services; using TaxBaik.Application; using TaxBaik.Infrastructure; var builder = WebApplication.CreateBuilder(args); builder.Services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme) .AddCookie(opts => { opts.LoginPath = "/login"; opts.ExpireTimeSpan = TimeSpan.FromHours(8); }); builder.Services.AddAuthorizationCore(); builder.Services.AddRazorPages(); builder.Services.AddServerSideBlazor(); builder.Services.AddMudServices(); builder.Services.AddMemoryCache(); builder.Services.AddInfrastructure(); builder.Services.AddApplication(); var app = builder.Build(); if (!app.Environment.IsDevelopment()) { app.UseExceptionHandler("/Error"); app.UseHsts(); } app.UsePathBase("/taxbaik/admin"); app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseRouting(); app.UseAuthentication(); app.UseAuthorization(); app.MapBlazorHub(); app.MapFallbackToPage("/_Host"); app.Run();