diff --git a/src/TaxBaik.Web/Program.cs b/src/TaxBaik.Web/Program.cs index 5c732cb..4702b3b 100644 --- a/src/TaxBaik.Web/Program.cs +++ b/src/TaxBaik.Web/Program.cs @@ -60,6 +60,16 @@ builder.Services.AddFastEndpoints(config => { config.Assemblies = new[] { typeof(Program).Assembly }; }); +// FastEndpoints Authorization Policy +builder.Services.AddAuthorization(opts => +{ + opts.DefaultPolicy = new Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder(JwtBearerDefaults.AuthenticationScheme) + .RequireAuthenticatedUser() + .Build(); + opts.AddPolicy("Bearer", new Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder(JwtBearerDefaults.AuthenticationScheme) + .RequireAuthenticatedUser() + .Build()); +}); builder.Services.AddProblemDetails(); builder.Services.AddHealthChecks(); builder.Services.AddRateLimiter(options => @@ -417,7 +427,6 @@ app.MapStaticAssets(); // API는 웹 서버에서만 제공 (클라이언트 프로젝트 분리 불필요) app.MapRazorComponents() .AddInteractiveWebAssemblyRenderMode() - .AddAdditionalAssemblies(typeof(TaxBaik.Web.Components.Admin._Imports).Assembly) .AllowAnonymous(); // 애플리케이션 시작/종료 로깅