From 6e20a3c51756c2e84290da6ec53b89a5fc58c0fc Mon Sep 17 00:00:00 2001 From: Vika Date: Wed, 28 Sep 2022 03:55:48 +0300 Subject: Use tokens from the auth backend to authenticate for Micropub --- kittybox-rs/src/main.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'kittybox-rs/src/main.rs') diff --git a/kittybox-rs/src/main.rs b/kittybox-rs/src/main.rs index 796903b..ad76042 100644 --- a/kittybox-rs/src/main.rs +++ b/kittybox-rs/src/main.rs @@ -123,11 +123,15 @@ async fn main() { )); let micropub = axum::Router::new() - .route("/.kittybox/micropub", kittybox::micropub::router(database.clone(), http.clone())) + .route("/.kittybox/micropub", kittybox::micropub::router( + database.clone(), + http.clone(), + auth_backend.clone() + )) .nest("/.kittybox/micropub/client", kittybox::companion::router()); let media = axum::Router::new() - .nest("/.kittybox/media", kittybox::media::router(blobstore).layer(axum::Extension(http))); + .nest("/.kittybox/media", kittybox::media::router(blobstore, auth_backend.clone())); let indieauth = kittybox::indieauth::router(auth_backend, database.clone()); @@ -165,13 +169,6 @@ async fn main() { .merge(media) .merge(indieauth) .merge(technical) - .layer( - axum::Extension( - kittybox::tokenauth::TokenEndpoint( - "https://tokens.indieauth.com/token".parse().unwrap() - ) - ) - ) .layer(tower::ServiceBuilder::new() .layer(tower_http::trace::TraceLayer::new_for_http()) .into_inner()) -- cgit 1.4.1