diff options
author | Vika <vika@fireburn.ru> | 2022-09-19 17:30:38 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2022-09-19 17:30:38 +0300 |
commit | 66049566ae865e1a4bd049257d6afc0abded16e9 (patch) | |
tree | 6013a26fa98a149d103eb4402ca91d698ef02ac2 /kittybox-rs/src/main.rs | |
parent | 696458657b26032e6e2a987c059fd69aaa10508d (diff) | |
download | kittybox-66049566ae865e1a4bd049257d6afc0abded16e9.tar.zst |
feat: indieauth support
Working: - Tokens and codes - Authenticating with a password Not working: - Setting the password (need to patch onboarding) - WebAuthn (the JavaScript is too complicated)
Diffstat (limited to 'kittybox-rs/src/main.rs')
-rw-r--r-- | kittybox-rs/src/main.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/kittybox-rs/src/main.rs b/kittybox-rs/src/main.rs index fcfc135..796903b 100644 --- a/kittybox-rs/src/main.rs +++ b/kittybox-rs/src/main.rs @@ -74,6 +74,16 @@ async fn main() { kittybox::media::storage::file::FileStore::new(path) }; + let auth_backend = { + let variable = std::env::var("AUTH_STORE_URI") + .unwrap(); + let folder = variable + .strip_prefix("file://") + .unwrap(); + kittybox::indieauth::backend::fs::FileBackend::new(folder) + }; + + // This code proves that different components of Kittybox can // be split up without hurting the app // @@ -119,7 +129,7 @@ async fn main() { let media = axum::Router::new() .nest("/.kittybox/media", kittybox::media::router(blobstore).layer(axum::Extension(http))); - //let indieauth = kittybox::indieauth::router(); + let indieauth = kittybox::indieauth::router(auth_backend, database.clone()); let technical = axum::Router::new() .route( @@ -153,7 +163,7 @@ async fn main() { .merge(onboarding) .merge(micropub) .merge(media) - //.merge(indieauth) + .merge(indieauth) .merge(technical) .layer( axum::Extension( |