Skip to content

Commit f64802e

Browse files
committed
enable hf dashboard
1 parent 69db574 commit f64802e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

rubberduckvba.Server/Program.cs

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
using Hangfire;
2+
using Hangfire.Annotations;
3+
using Hangfire.Dashboard;
24
using Hangfire.SqlServer;
35
using Microsoft.Extensions.Caching.Distributed;
46
using Microsoft.Extensions.Options;
@@ -18,6 +20,11 @@
1820

1921
namespace rubberduckvba.com.Server;
2022

23+
public class HangfireAuthenticationFilter : IDashboardAuthorizationFilter
24+
{
25+
public bool Authorize([NotNull] DashboardContext context) => true;
26+
}
27+
2128
public class Program
2229
{
2330
public static void Main(string[] args)
@@ -120,7 +127,7 @@ private static void StartHangfire(WebApplication app)
120127
hangfireOptions.UpdateXmldocContentSchedule);
121128
}
122129

123-
app.UseHangfireDashboard(HangfireConstants.DashboardUrl, storage: scheduler.Storage);
130+
app.UseHangfireDashboard(HangfireConstants.DashboardUrl, new DashboardOptions { DarkModeEnabled = true, Authorization = [new HangfireAuthenticationFilter()] }, scheduler.Storage);
124131
CleanStartHangfire(scheduler.Storage);
125132
}
126133
}

0 commit comments

Comments
 (0)