From cbbfca9af1f0aa9da87709f99353fd76fd6617a8 Mon Sep 17 00:00:00 2001 From: Vika Date: Wed, 5 May 2021 22:40:01 +0300 Subject: Added rudimentary caching to IndieAuth middleware --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 86376d4..c422fea 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,7 +8,7 @@ mod database; mod indieauth; mod micropub; -use crate::indieauth::check_auth; +use crate::indieauth::IndieAuthMiddleware; use crate::micropub::{get_handler,post_handler}; #[derive(Clone)] @@ -39,7 +39,7 @@ fn equip_app(mut app: App) -> App where Storage: database::Storage + Send + Sync + Clone { - app.at("/micropub").with(check_auth).get(get_handler).post(post_handler); + app.at("/micropub").with(IndieAuthMiddleware::new()).get(get_handler).post(post_handler); // The Micropub client. It'll start small, but could grow into something full-featured! app.at("/micropub/client").get(|_: Request<_>| async move { Ok(Response::builder(200).body(MICROPUB_CLIENT).content_type("text/html").build()) -- cgit 1.4.1