fix: middlewares

This commit is contained in:
CyberL1 2024-05-24 07:46:18 +02:00
parent 7296067e21
commit 24cb563cd0

View File

@ -43,9 +43,6 @@ if (app.Environment.IsDevelopment())
app.UseSwaggerUI();
}
app.UseMiddleware<MinecraftCookieMiddleware>();
app.UseMiddleware<CheckRealmOwnerMiddleware>();
var scope = app.Services.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<DataContext>();
@ -69,5 +66,8 @@ if (!Enum.IsDefined(typeof(WorkModeEnum), mode.Value))
var rewriteOptions = new RewriteOptions().AddRewrite(@"^(?!.*configuration)(.*)$", $"modes/{mode.Value}/$1", true);
app.UseRewriter(rewriteOptions);
app.UseMiddleware<MinecraftCookieMiddleware>();
app.UseMiddleware<CheckRealmOwnerMiddleware>();
Console.WriteLine($"Running in {mode.Value} mode");
app.Run();