backend + web: Protect Swagger UI behind admin login

This commit is contained in:
GonnaHetzMe committed 2026-12-03 00:49:36 +01:00
1 parent d8de714481
commit eddf5837eb
16 files changed
+158 -28

No files matched your search

+7
View File
@@ -115,6 +115,13 @@ app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
app.MapSwaggerUI("swagger", options =>
{
options.SwaggerEndpoint("v1/swagger.json", "Helpdesk API v1");
options.DocumentTitle = "Helpdesk API";
options.CacheLifetime = null;
}).RequireAuthorization(policy => policy.RequireRole(UserRoles.Admin));
app.MapStaticAssets();
app.MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}").WithStaticAssets();