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:
co-authored by
Claude Opus 4.6
parent
4ee00f1fe5
commit
f225ee8969
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user