diff --git a/lib/middleware/session-middleware.js b/lib/middleware/session-middleware.js new file mode 100644 index 0000000000..f33e63cad3 --- /dev/null +++ b/lib/middleware/session-middleware.js @@ -0,0 +1,8 @@ +'use strict'; + +const cookieSession = require('cookie-session'); + +module.exports = config => { + config.a = 1; + return cookieSession(config.field); +}; diff --git a/package.json b/package.json index d128c058d6..7daacc0625 100644 --- a/package.json +++ b/package.json @@ -60,6 +60,7 @@ "body-parser": "^1.18.2", "commander": "^2.9.0", "cookie-parser": "^1.4.3", + "cookie-session": "^2.0.0-beta.3", "db-migrate": "0.10.0-beta.24", "db-migrate-pg": "^0.2.4", "deep-diff": "^0.3.3", diff --git a/yarn.lock b/yarn.lock index 5dc8e1f133..17c7a3880a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1189,6 +1189,15 @@ cookie-parser@^1.4.3: cookie "0.3.1" cookie-signature "1.0.6" +cookie-session@^2.0.0-beta.3: + version "2.0.0-beta.3" + resolved "https://registry.yarnpkg.com/cookie-session/-/cookie-session-2.0.0-beta.3.tgz#4e446bd9f85bd7e27d3e226f4e99af12011a4386" + dependencies: + cookies "0.7.1" + debug "3.1.0" + on-headers "~1.0.1" + safe-buffer "5.1.1" + cookie-signature@1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" @@ -1201,6 +1210,13 @@ cookiejar@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.1.tgz#41ad57b1b555951ec171412a81942b1e8200d34a" +cookies@0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/cookies/-/cookies-0.7.1.tgz#7c8a615f5481c61ab9f16c833731bcb8f663b99b" + dependencies: + depd "~1.1.1" + keygrip "~1.0.2" + core-assert@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/core-assert/-/core-assert-0.2.1.tgz#f85e2cf9bfed28f773cc8b3fa5c5b69bdc02fe3f" @@ -3068,6 +3084,10 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.10.0" +keygrip@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/keygrip/-/keygrip-1.0.2.tgz#ad3297c557069dea8bcfe7a4fa491b75c5ddeb91" + kind-of@^3.0.2: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64"