|
3 | 3 | async fn main() { |
4 | 4 | use std::sync::Arc; |
5 | 5 |
|
6 | | - use axum::{middleware::from_fn, routing::get, Router}; |
7 | | - use leptos::config::{get_configuration, LeptosOptions}; |
8 | | - use leptos_axum::{generate_route_list, LeptosRoutes}; |
| 6 | + use axum::{Router, middleware::from_fn, routing::get}; |
| 7 | + use leptos::config::{LeptosOptions, get_configuration}; |
| 8 | + use leptos_axum::{LeptosRoutes, generate_route_list}; |
9 | 9 | use shield::{Shield, ShieldOptions}; |
10 | 10 | use shield_examples_leptos_axum::app::*; |
11 | | - use shield_leptos_axum::{auth_required, provide_axum_integration, AuthRoutes, ShieldLayer}; |
| 11 | + use shield_leptos_axum::{AuthRoutes, ShieldLayer, auth_required, provide_axum_integration}; |
12 | 12 | use shield_memory::{MemoryStorage, User}; |
13 | 13 | use shield_oidc::{Keycloak, OidcProvider}; |
14 | 14 | use time::Duration; |
@@ -65,7 +65,7 @@ async fn main() { |
65 | 65 |
|
66 | 66 | // Initialize router |
67 | 67 | let router = Router::new() |
68 | | - .route("/api/protected", get(|| async { "Protected" })) |
| 68 | + .route("/api/protected", get(async || "Protected")) |
69 | 69 | .route_layer(from_fn(auth_required::<User>)) |
70 | 70 | .nest("/api/auth", AuthRoutes::router::<User, LeptosOptions>()) |
71 | 71 | .merge(SwaggerUi::new("/api-docs").url("/api/openapi.json", Docs::openapi())) |
|
0 commit comments