From 1f33a60f7ae63954269cf244d8cc881a2656a74a Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Sat, 17 Jun 2023 11:29:51 -0700 Subject: [PATCH] Set secrete_key to fix cookie persistence --- .env.example | 4 +++- src/main.rs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 842628a..594bf3c 100644 --- a/.env.example +++ b/.env.example @@ -1,3 +1,5 @@ CLIENT_ID= CLIENT_SECRET= -DOMAIN=https://tegakituesday.com/ \ No newline at end of file +DOMAIN=https://tegakituesday.com/ +# head -c64 /dev/urandom | base64 +SECRET= \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 7476d2b..38915e5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -309,8 +309,10 @@ impl User { #[launch] fn rocket() -> _ { - let config = rocket::Config::figment().merge(("port", 1313)); dotenv::dotenv().expect("Failed to load .env file"); + let config = rocket::Config::figment() + .merge(("port", 1313)) + .merge(("secret_key", env::var("SECRET").expect("Must have SECRET defined in .env for private cookie persistence"))); rocket::custom(config) .mount( "/",