fix: correct middleware layer ordering in hackathon routes

The hackathon_auth_middleware requires Arc<PgPool> from Extension,
but was applied as the outermost layer (running before Extension(pool)
was injected). Swapped layer order so pool Extension is outermost,
making it available when the auth middleware runs.

Fixes 500 errors on all /v1/hackathon/* authenticated endpoints.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
maulanasdqnandClaude Opus 4.6 committed 2026-04-09 22:21:30 +07:00
1 parent 4ee00f1fe5
commit f225ee8969
8 files changed
+9 -10

No files matched your search

@@ -30,6 +30,6 @@ pub fn build_join_request_routes(pool: Arc<PgPool>) -> Router {
post(respond_to_join_request_handler),
)
.layer(Extension(service))
.layer(Extension(pool))
.layer(from_fn(hackathon_auth_middleware))
.layer(Extension(pool))
}