Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AsyncAuthorization causes issues with Dashboard UI #2382

Open
sinanilyas opened this issue Mar 20, 2024 · 0 comments
Open

AsyncAuthorization causes issues with Dashboard UI #2382

sinanilyas opened this issue Mar 20, 2024 · 0 comments

Comments

@sinanilyas
Copy link

sinanilyas commented Mar 20, 2024

When I use AsyncAuthorization, it causes issues with the Dashboard UI.

Styles and scripts fails to load correctly, leading the graphics to disappear in the home page of the dashboard. In addition, trigger and delete buttons remain disabled when a recurring job is selected.

Here's my code:

var userManager = app.Services.GetRequiredService<IServiceScopeFactory>().CreateScope()
	.ServiceProvider.GetRequiredService<UserManager<ApplicationUser>>();

app.UseHangfireDashboard("/Hangfire", new DashboardOptions
{
	DashboardTitle = "Dashboard",
	DisplayStorageConnectionString = false,
	AppPath = "/App",
	AsyncAuthorization = new [] { new MyAsyncAuthorizationFilter(userManager) }
});

When I use Authorization instead of AsyncAuthorization as below, everything works fine.

var userManager = app.Services.GetRequiredService<IServiceScopeFactory>().CreateScope()
	.ServiceProvider.GetRequiredService<UserManager<ApplicationUser>>();

app.UseHangfireDashboard("/Hangfire", new DashboardOptions
{
	DashboardTitle = "Dashboard",
	DisplayStorageConnectionString = false,
	AppPath = "/App",
	Authorization = new [] { new MyAuthorizationFilter(userManager) }
});

I'm currently using ASP.NET 8.0.1 with Hangfire 1.8.11 Nuget package installed.

@sinanilyas sinanilyas changed the title is:issue AsyncAuthorization breaks UI Mar 20, 2024
@sinanilyas sinanilyas changed the title AsyncAuthorization breaks UI AsyncAuthorization causes issues with Dashboard UI Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant