@@ -20,7 +20,7 @@ pub fn create_app_router(app_state: AppState) -> Router {
2020 // required authentication
2121 . merge ( protected_routes ( app_state. clone ( ) ) )
2222 // optional authentication
23- . merge ( semi_protected_routes ( app_state. clone ( ) ) )
23+ // .merge(semi_protected_routes(app_state.clone()))
2424 // admin routes
2525 . merge ( create_admin_routes ( app_state. clone ( ) ) )
2626 // API routes
@@ -44,6 +44,7 @@ async fn not_found() -> impl IntoResponse {
4444/// Public routes that don't require authentication
4545fn public_routes ( ) -> Router < AppState > {
4646 Router :: new ( )
47+ . route ( "/" , get ( home_page) )
4748}
4849
4950/// Protected routes that require authentication
@@ -57,14 +58,13 @@ fn protected_routes(app_state: AppState) -> Router<AppState> {
5758}
5859
5960/// Routes that work with and without authentication
60- fn semi_protected_routes ( app_state : AppState ) -> Router < AppState > {
61- Router :: new ( )
62- . route ( "/" , get ( home_page) )
63- . layer ( axum_middleware:: from_fn_with_state (
64- app_state,
65- middleware:: optional_auth,
66- ) )
67- }
61+ // fn semi_protected_routes(app_state: AppState) -> Router<AppState> {
62+ // Router::new()
63+ // .layer(axum_middleware::from_fn_with_state(
64+ // app_state,
65+ // middleware::optional_auth,
66+ // ))
67+ // }
6868
6969/// Admin routes that require admin privileges
7070pub fn create_admin_routes ( app_state : AppState ) -> Router < AppState > {
0 commit comments