backend + web: Protect Swagger UI behind admin login
This commit is contained in:
1 parent
d8de714481
commit
eddf5837eb
16 files changed
+158
-28
No files matched your search
@@ -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();
|
||||
|
||||
|
||||
Reference in new issue
Block a user