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

404 on all static files as soon as authorization is required #109

Open
chaelli opened this issue Jul 9, 2024 · 0 comments
Open

404 on all static files as soon as authorization is required #109

chaelli opened this issue Jul 9, 2024 · 0 comments

Comments

@chaelli
Copy link

chaelli commented Jul 9, 2024

I have a very strange behavior. As soon as I am not on "Development" I get 404s on all static files
image

I added app.UseCoreAdminCustomAuth((serviceProvider) => Task.FromResult(true)); to make sure I am always authenticated. But still, the issue happens.
my program.cs looks like this:

var builder = WebApplication.CreateBuilder(args);

builder.Configuration.AddJsonFile("appsettings.local.json", optional: true, reloadOnChange: true);
builder.Configuration.AddEnvironmentVariables();

builder.Services.AddHttpContextAccessor();
builder.Services.AddServices();
builder.Services.AddControllers();

builder.Services.AddDbContext<MyDbContext>(option =>
    option.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnection")));

// add core admin
builder.Services.AddCoreAdmin();

var app = builder.Build();

app.UseStaticFiles();
app.UseAuthorization();
app.MapControllers();
app.MapDefaultControllerRoute();
app.UseCoreAdminCustomAuth((serviceProvider) => Task.FromResult(true));
app.Run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant