hapi-stateless-notifications
Advanced tools
Comparing version 3.0.0 to 3.1.0
12
index.js
var P = require('bluebird'); | ||
var TokenFacilitator = require('token-facilitator'); | ||
var crypto = require('crypto'); | ||
var debug = require('debuglog')('hapi-stateless-notifications'); | ||
@@ -17,2 +18,3 @@ exports.register = function(server, options, next) { | ||
return P.resolve(promise).then(function(successNotice) { | ||
debug("Success '%s' for request '%s'", successNotice, request.id); | ||
return P.resolve({ | ||
@@ -23,2 +25,3 @@ notice: successNotice, | ||
}).catch(function(error) { | ||
debug("Error '%s' for request '%s'", error.message, request.id); | ||
return P.resolve({ | ||
@@ -29,3 +32,9 @@ notice: error.message, | ||
}); | ||
})).then(putNoticesInRedis(request.redis, options)); | ||
})).then(putNoticesInRedis(request.redis, options)).then(function (token) { | ||
debug("Saved to redis for '%s' with token '%s'", request.id, token); | ||
return token; | ||
}, function (err) { | ||
debug("Error saving to redis for '%s'", request.id); | ||
throw err; | ||
}); | ||
}; | ||
@@ -51,3 +60,2 @@ | ||
request.logger.info("Found notices", data); | ||
@@ -54,0 +62,0 @@ |
{ | ||
"name": "hapi-stateless-notifications", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "A simple, explicit-state plugin to pass notices between pages.", | ||
@@ -21,2 +21,3 @@ "main": "index.js", | ||
"bluebird": "^3.0.5", | ||
"debuglog": "^1.0.1", | ||
"token-facilitator": "^2.2.0" | ||
@@ -23,0 +24,0 @@ }, |
@@ -36,2 +36,5 @@ var test = require('tap').test; | ||
reply(token); | ||
}).catch(function (err) { | ||
t.error(err); | ||
reply(err); | ||
}); | ||
@@ -38,0 +41,0 @@ } |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
8640
180
0
3
+ Addeddebuglog@^1.0.1
+ Addeddebuglog@1.0.1(transitive)