File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -258,12 +258,15 @@ async fn main() {
258258
259259 . layer ( RequestBodyLimitLayer :: new ( ADMIN_BODY_LIMIT ) )
260260
261- . layer ( GovernorLayer :: new ( admin_rate_limit_config. clone ( ) ) ) ;
261+ . layer ( GovernorLayer :: new ( admin_rate_limit_config. clone ( ) ) )
262+ . with_state ( pool. clone ( ) ) ;
262263
263264 // Define the application router with all routes and middleware
265+ let login_router_with_state = login_router. with_state ( pool. clone ( ) ) ;
266+
264267 let mut app = Router :: default ( )
265268 // Merge all route modules
266- . merge ( login_router )
269+ . merge ( login_router_with_state )
267270
268271 . route ( "/api/auth/me" , get ( handlers:: auth:: me) )
269272
@@ -299,7 +302,6 @@ async fn main() {
299302 "/api/posts/{id}/comments" ,
300303 get ( handlers:: comments:: list_post_comments)
301304 . post ( handlers:: comments:: create_post_comment)
302- . route_layer ( from_extractor :: < csrf:: CsrfGuard > ( ) )
303305 . route_layer ( GovernorLayer :: new ( admin_rate_limit_config. clone ( ) ) ) ,
304306 )
305307 . route (
You can’t perform that action at this time.
0 commit comments