Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hapi-stateless-notifications

Package Overview
Dependencies
Maintainers
17
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-stateless-notifications - npm Package Compare versions

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 @@

3

package.json
{
"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 @@ }

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