postIt #2

Merged
notazof merged 27 commits from postIt into main 2026-07-11 02:57:29 +01:00
Showing only changes of commit 006e05a375 - Show all commits

fix(blogs): register controller endpoints via MapControllers

All [ApiController] classes (BlogApi, BlogTags, PostTags, FileSystem,
FileSystemStream, Comments, TagsApi) returned 404 on every route,
even though Kestrel was up. The pipeline in Program.cs was missing
MapControllers(), so the controllers were never attached to the
endpoint data source. MapIdentityApi and MapGet("/identity")
worked because they're explicit minimal-API routes; the attribute-
routed controllers didn't.

Confirmed end-to-end: GET /api/v1/blog now returns 401 (auth
required by [Authorize("BlogScope")]) instead of 404.
Paul Schneider 2026-07-07 21:48:02 +01:00

View file

@ -88,6 +88,7 @@ internal class Program
.UseAuthorization()
.UseCors("default")
;
app.MapControllers();
app.MapIdentityApi<ApplicationUser>().RequireAuthorization("BlogScope");
app.MapGet("/identity", (HttpContext context) =>