fix: auth for admin
This commit is contained in:
parent
6fb90e42c3
commit
a2a0fe5510
9 changed files with 129 additions and 46 deletions
|
|
@ -185,10 +185,15 @@ mod server {
|
|||
leptos_options: leptos_options.clone(),
|
||||
};
|
||||
|
||||
// Create admin connection layer for RLS context on admin API routes
|
||||
let admin_conn_layer =
|
||||
chattyness_admin_ui::auth::AdminConnLayer::new(pool.clone());
|
||||
|
||||
// Build nested API routers with their own state
|
||||
let user_api_router = chattyness_user_ui::api::api_router().with_state(user_api_state);
|
||||
let admin_api_router =
|
||||
chattyness_admin_ui::api::admin_api_router().with_state(admin_api_state);
|
||||
let admin_api_router = chattyness_admin_ui::api::admin_api_router()
|
||||
.layer(admin_conn_layer)
|
||||
.with_state(admin_api_state);
|
||||
|
||||
// Create RLS layer for row-level security
|
||||
let rls_layer = chattyness_user_ui::auth::RlsLayer::new(pool.clone());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue