From 1600b7c80ec703379487662e451bbcde4cf40784 Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Mon, 2 Aug 2021 19:23:17 -0400 Subject: [PATCH] Fix config environment reference --- src/webqueue2api/api/app.py | 2 +- webqueue2api_config.config | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 webqueue2api_config.config diff --git a/src/webqueue2api/api/app.py b/src/webqueue2api/api/app.py index 99282be..477ce50 100644 --- a/src/webqueue2api/api/app.py +++ b/src/webqueue2api/api/app.py @@ -19,7 +19,7 @@ # Look for JWTs in headers (for access) then cookies (for refresh) app.config["JWT_TOKEN_LOCATION"] = ["headers", "cookies"] # Restrict cookies to HTTPS in prod, allow HTTP in dev -app.config["JWT_COOKIE_SECURE"] = False if config.jwt_secret_key == "dev" else True +app.config["JWT_COOKIE_SECURE"] = False if config.environment == "dev" else True # Restrict cookies using SameSite=strict flag app.config["JWT_COOKIE_SAMESITE"] = "strict" # Restrict refresh tokens to /token/refresh endpoint diff --git a/webqueue2api_config.config b/webqueue2api_config.config new file mode 100644 index 0000000..81d51dc --- /dev/null +++ b/webqueue2api_config.config @@ -0,0 +1,2 @@ +[api] +environment = dev \ No newline at end of file