From 4bacba7cece901f9c25a450eb4b7bc8969bb5e9e Mon Sep 17 00:00:00 2001 From: Vika Date: Tue, 9 Jul 2024 00:36:48 +0300 Subject: Start working on login functionality --- src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main.rs') 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, ])); -- cgit 1.4.1