diff options
author | Vika <vika@fireburn.ru> | 2022-09-28 03:55:48 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2022-09-28 03:55:48 +0300 |
commit | 6e20a3c51756c2e84290da6ec53b89a5fc58c0fc (patch) | |
tree | a360c40dce27b7804001038babd4631476232001 /kittybox-rs/src/main.rs | |
parent | 2f02bf76a40c971b9404aa0913bc8baa7dfde24c (diff) | |
download | kittybox-6e20a3c51756c2e84290da6ec53b89a5fc58c0fc.tar.zst |
Use tokens from the auth backend to authenticate for Micropub
Diffstat (limited to 'kittybox-rs/src/main.rs')
-rw-r--r-- | kittybox-rs/src/main.rs | 15 |
1 files changed, 6 insertions, 9 deletions
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()) |