diff --git a/rubberduckvba.Server/Program.cs b/rubberduckvba.Server/Program.cs index 4538a10..5baf81c 100644 --- a/rubberduckvba.Server/Program.cs +++ b/rubberduckvba.Server/Program.cs @@ -1,4 +1,6 @@ using Hangfire; +using Hangfire.Annotations; +using Hangfire.Dashboard; using Hangfire.SqlServer; using Microsoft.Extensions.Caching.Distributed; using Microsoft.Extensions.Options; @@ -18,6 +20,11 @@ namespace rubberduckvba.com.Server; +public class HangfireAuthenticationFilter : IDashboardAuthorizationFilter +{ + public bool Authorize([NotNull] DashboardContext context) => true; +} + public class Program { public static void Main(string[] args) @@ -120,7 +127,7 @@ private static void StartHangfire(WebApplication app) hangfireOptions.UpdateXmldocContentSchedule); } - app.UseHangfireDashboard(HangfireConstants.DashboardUrl, storage: scheduler.Storage); + app.UseHangfireDashboard(HangfireConstants.DashboardUrl, new DashboardOptions { DarkModeEnabled = true, Authorization = [new HangfireAuthenticationFilter()] }, scheduler.Storage); CleanStartHangfire(scheduler.Storage); } }