New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

connect-concierge

Package Overview
Dependencies
Maintainers
1
Versions
127
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

connect-concierge - npm Package Compare versions

Comparing version 0.3.5 to 0.3.6

31

libs/connect-concierge.js

@@ -7,3 +7,3 @@

(function() {
var ConnectConcierge, connectVtexid, dust, fs, request, urlencode, utils, _, _isAdmin;
var ConnectConcierge, NodeCache, connectVtexid, dust, fs, request, urlencode, utils, _, _isAdmin;

@@ -24,2 +24,4 @@ fs = require('fs');

NodeCache = require('node-cache');
_isAdmin = utils.isAdmin;

@@ -104,5 +106,11 @@

ConnectConcierge.prototype.licenseManagerCall = function(options) {
var FIVE_MINUTES, cache;
if (options == null) {
options = {};
}
FIVE_MINUTES = 5 * 60;
options.ttl || (options.ttl = FIVE_MINUTES);
cache = new NodeCache({
stdTTL: options.ttl
});
return function(req, res, next) {

@@ -121,8 +129,19 @@ var licenseManagerEnv;

};
return request.get(options, function(error, response, body) {
if (error) {
return next(error);
return cache.get(req.cookies.VtexIdclientAutCookie, function(err, value) {
if (err) {
return next(err);
}
req.licenseManagerResponse = body;
return next();
if (value[req.cookies.VtexIdclientAutCookie]) {
req.licenseManagerResponse = value[req.cookies.VtexIdclientAutCookie];
return next();
} else {
return request.get(options, function(error, response, body) {
if (error) {
return next(error);
}
req.licenseManagerResponse = body;
cache.set(req.cookies.VtexIdclientAutCookie, body);
return next();
});
}
});

@@ -129,0 +148,0 @@ };

5

package.json
{
"name": "connect-concierge",
"version": "0.3.5",
"version": "0.3.6",
"description": "Connect middlewares for VTEX backoffice app Concierge",

@@ -33,4 +33,5 @@ "main": "main.js",

"urlencode": "~0.2.0",
"connect-vtexid": "~0.1.1"
"connect-vtexid": "~0.1.1",
"node-cache": "~1.0.3"
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc