connect-concierge
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -30,5 +30,8 @@ | ||
ConnectConcierge.prototype.getEnvironment = function() { | ||
ConnectConcierge.prototype.getEnvironment = function(options) { | ||
return function(req, res, next) { | ||
var env, envRegex, match; | ||
if (_isAdmin(req, options) === false) { | ||
return next(); | ||
} | ||
envRegex = /(.*)\.vtex(commerce|commercebeta|commercealfa|commercestable|local)\.com.br/; | ||
@@ -180,7 +183,12 @@ match = envRegex.exec(req.headers.host) || []; | ||
match = vtexIdCookieRegexp.exec(req.headers.cookie); | ||
VtexIdclientAutCookie = match[1]; | ||
if (match === null) { | ||
VtexIdclientAutCookie = null; | ||
} else { | ||
if (match != null) { | ||
VtexIdclientAutCookie = match[1]; | ||
} | ||
} | ||
req.cookies || (req.cookies = {}); | ||
req.cookies.VtexIdclientAutCookie = VtexIdclientAutCookie; | ||
if (req.cookies.VtexIdclientAutCookie == null) { | ||
console.log('redirecting to ', redirectUrl); | ||
res.statusCode = 302; | ||
@@ -187,0 +195,0 @@ res.setHeader('Location', redirectUrl); |
{ | ||
"name": "connect-concierge", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Connect middlewares for VTEX backoffice app Concierge", | ||
@@ -5,0 +5,0 @@ "main": "main.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26874
232