pub async fn basic_auth_middleware(
__arg0: State<Arc<BasicAuthConfig>>,
request: Request<Body>,
next: Next,
) -> ResponseExpand description
Middleware function for use with axum::middleware::from_fn_with_state
§Example
ⓘ
use at_jet::middleware::{BasicAuthConfig, basic_auth_middleware};
let config = BasicAuthConfig::new("admin", "password")
.realm("Admin Area")
.exclude("/health");
let app = Router::new()
.route("/admin", get(handler))
.layer(axum::middleware::from_fn_with_state(
Arc::new(config),
basic_auth_middleware,
));