app.Use((context, next) => {
// Ignore requests that don't point to static files.
if (context.Request.Path.StartsWithSegments("/Cvler"))
{
if (context.User.Identities.Any(identity => identity.HasClaim("pozisyon", "admin")))
{
return next();
}
context.Response.StatusCode = 401;
return Task.FromResult(0);
}
return next();
// Stop processing the request and return a 401 response.
});
Hi all, i want to hide CV folder from everyone except admin while development mode its working after publish middleware does not work everyone can see folder
problem was i write app.usestaticfiles before middleware app.use