From 8e1ead37e6184691abb07dbeb4bc096ece3638a2 Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Sat, 9 Apr 2022 18:28:59 -0500 Subject: [PATCH] Allowing proxying for secure cookies. --- .gitignore | 1 + sports-matcher/client/package.json | 4 ++-- sports-matcher/scripts/build.py | 2 +- sports-matcher/server/middleware/authority.js | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) mode change 100644 => 100755 sports-matcher/scripts/build.py diff --git a/.gitignore b/.gitignore index 706e0a5..e9f09c6 100644 --- a/.gitignore +++ b/.gitignore @@ -165,3 +165,4 @@ dist # End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,node +**/server/public/** \ No newline at end of file diff --git a/sports-matcher/client/package.json b/sports-matcher/client/package.json index 290931b..c4b36e1 100644 --- a/sports-matcher/client/package.json +++ b/sports-matcher/client/package.json @@ -18,7 +18,7 @@ }, "scripts": { "start": "NODE_ENV='development' REACT_APP_API_HOST='http://localhost:5000' react-scripts start", - "build": "../scripts/build.py", + "build": "python3 ../scripts/build.py", "test": "react-scripts test", "eject": "react-scripts eject" }, @@ -44,4 +44,4 @@ "eslint": "^8.12.0", "eslint-plugin-react": "^7.29.4" } -} +} \ No newline at end of file diff --git a/sports-matcher/scripts/build.py b/sports-matcher/scripts/build.py old mode 100644 new mode 100755 index 8d6e004..0b66b86 --- a/sports-matcher/scripts/build.py +++ b/sports-matcher/scripts/build.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 import os import shutil diff --git a/sports-matcher/server/middleware/authority.js b/sports-matcher/server/middleware/authority.js index f7ff1b5..a253a20 100644 --- a/sports-matcher/server/middleware/authority.js +++ b/sports-matcher/server/middleware/authority.js @@ -14,6 +14,7 @@ const sessionConf = { }; if (process.env.NODE_ENV === "production") { sessionConf.cookie.secure = true; + sessionConf.proxy = true; sessionConf.store = MongoStore.create({ mongoUrl: mongoURI, dbName: mongooseDbName }); } export const userSession = session(sessionConf);