From b98646d8501689072f5624483d258adcbf6fc5c5 Mon Sep 17 00:00:00 2001 From: Cara Salter Date: Wed, 20 Jul 2022 08:32:05 -0400 Subject: auth: Set path to root for cookies --- Cargo.lock | 2 ++ Cargo.toml | 2 +- src/handlers/auth.rs | 4 +++- src/main.rs | 6 +++--- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dfe189f..6be56e3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -430,8 +430,10 @@ checksum = "94d4706de1b0fa5b132270cddffa8585166037822e260a944fe161acd137ca05" dependencies = [ "aes-gcm", "base64", + "hmac 0.12.1", "percent-encoding", "rand", + "sha2 0.10.2", "subtle", "time 0.3.11", "version_check", diff --git a/Cargo.toml b/Cargo.toml index 9c656f6..b055fd1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ build = "src/build.rs" [dependencies] axum = { version = "0.5.13", features = ["json", "tower-log"] } -axum-extra = { version = "0.3.6", features = ["spa", "cookie", "cookie-private"] } +axum-extra = { version = "0.3.6", features = ["spa", "cookie", "cookie-private", "cookie-signed"] } color-eyre = "0.6.2" hyper = { version = "0.14.20", features = ["full"] } serde = { version = "1.0.139", features = ["derive"] } diff --git a/src/handlers/auth.rs b/src/handlers/auth.rs index 7e2642c..c00fb8d 100644 --- a/src/handlers/auth.rs +++ b/src/handlers/auth.rs @@ -43,7 +43,9 @@ pub async fn login_post(Form(login): Form, state: Extension>, jar: PrivateCookieJar) -> HtmlResul async fn statics(Path(name): Path) -> Result { for s in templates::statics::STATICS { - debug!("Name: {}\nContents:\n{:?}\n\n", s.name, s.content); + trace!("Name: {}\nContents:\n{:?}\n\n", s.name, s.content); } match templates::statics::StaticFile::get(&name) { -- cgit v1.2.3