diff options
author | Vika <vika@fireburn.ru> | 2024-07-09 00:36:48 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2024-07-09 22:44:01 +0300 |
commit | 4bacba7cece901f9c25a450eb4b7bc8969bb5e9e (patch) | |
tree | 3fadb955d1d53ac15b2247fb88050fbf6abd3717 /src/main.rs | |
parent | 2e9c292bb989ffff2c99aa2a6062962c913b3586 (diff) | |
download | kittybox-4bacba7cece901f9c25a450eb4b7bc8969bb5e9e.tar.zst |
Start working on login functionality
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index b7a6035..9e541b9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -221,6 +221,9 @@ async fn compose_kittybox( other => unimplemented!("Unsupported backend: {other}") }; + // TODO: load from environment + let cookie_key = axum_extra::extract::cookie::Key::generate(); + let router = router .route( "/.kittybox/static/:path", @@ -228,11 +231,11 @@ async fn compose_kittybox( ) .route("/.kittybox/coffee", teapot_route()) .nest("/.kittybox/micropub/client", kittybox::companion::router()) + .nest("/.kittybox/login", kittybox::login::router(cookie_key)) .layer(tower_http::trace::TraceLayer::new_for_http()) .layer(tower_http::catch_panic::CatchPanicLayer::new()) .layer(tower_http::sensitive_headers::SetSensitiveHeadersLayer::new([ axum::http::header::AUTHORIZATION, - // Not used yet, but will be eventually axum::http::header::COOKIE, axum::http::header::SET_COOKIE, ])); |