Comparing version 0.2.0 to 0.3.0
@@ -92,3 +92,14 @@ 'use strict'; | ||
} | ||
cb(JSON.parse(body)); | ||
var parsedResponse; | ||
try { | ||
parsedResponse = JSON.parse(body); | ||
invariant(typeof parsedResponse.type === 'string', 'verdict did not include a type key'); | ||
} catch (e) { | ||
// fail open | ||
cb({type: 'ALLOW', info: 'Bad response from server: ' + e.toString()}); | ||
return; | ||
} | ||
cb(parsedResponse); | ||
}); | ||
@@ -95,0 +106,0 @@ }); |
{ | ||
"name": "authbox", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
21225
209