35323f2b2c
- 대시보드: KPI 카드 (이번달 문의, 신규 문의, 포스트 수) - 블로그 관리: 목록/작성/수정 페이지 - 문의 관리: 목록 및 상태 변경 - 설정: 사이트 연락처 정보 - 인증: Cookie 기반 8시간 세션 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
42 lines
1.1 KiB
C#
42 lines
1.1 KiB
C#
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);
|
|
opts.Cookie.SameSite = SameSiteMode.Lax;
|
|
});
|
|
builder.Services.AddAuthorizationCore();
|
|
|
|
builder.Services.AddRazorComponents()
|
|
.AddInteractiveServerComponents();
|
|
builder.Services.AddMudServices();
|
|
builder.Services.AddMemoryCache();
|
|
builder.Services.AddInfrastructure();
|
|
builder.Services.AddApplication();
|
|
|
|
var app = builder.Build();
|
|
|
|
if (!app.Environment.IsDevelopment())
|
|
{
|
|
app.UseExceptionHandler("/Error", createScopeForErrors: true);
|
|
app.UseHsts();
|
|
}
|
|
|
|
app.UsePathBase("/taxbaik/admin");
|
|
app.UseHttpsRedirection();
|
|
app.UseStaticFiles();
|
|
app.UseRouting();
|
|
app.UseAuthentication();
|
|
app.UseAuthorization();
|
|
|
|
app.MapRazorComponents<TaxBaik.Admin.Components.App>()
|
|
.AddInteractiveServerRenderMode();
|
|
|
|
app.Run();
|