@optimiser/common 1.0.345 → 1.0.346

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -86,6 +86,14 @@ var Connection = /** @class */ (function () {
86
86
  * @description middleware function : to validate the cookies that are passed in request
87
87
  */
88
88
  this.ValidateSession = function (req, res, next) {
89
+ // If the header 'x-access-token' exists, override the req.cookies.msp_d.token
90
+ if (req.headers['x-access-token']) {
91
+ if (!req.cookies)
92
+ req.cookies = {};
93
+ if (!req.cookies.msp_d)
94
+ req.cookies.msp_d = {};
95
+ req.cookies.msp_d.token = req.headers['x-access-token'];
96
+ }
89
97
  if (req.cookies && req.cookies.msp_d && _this.redisClient) {
90
98
  _this.redisClient.hgetall(req.cookies.msp_d.token, function (err, tokenData) {
91
99
  if (tokenData === undefined || tokenData === null || Object.keys(tokenData).length == 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optimiser/common",
3
- "version": "1.0.345",
3
+ "version": "1.0.346",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {