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

authbox

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

authbox - npm Package Compare versions

Comparing version 0.3.0 to 0.6.0

example-connect.js

27

lib/middleware.js

@@ -11,2 +11,3 @@ 'use strict';

var os = require('os');
var responseCookie = require('response-cookie');
var sha256 = require('sha256');

@@ -24,12 +25,24 @@

var cookieParserMiddleware = cookieParser();
var responseCookieMiddleware = responseCookie();
function middleware(req, res, next) {
var nextMiddleware = _middleware;
if (!res.cookie) {
nextMiddleware = function(req, res, next) {
responseCookieMiddleware(req, res, function() {
_middleware(req, res, next);
});
};
}
if (!req.cookies) {
// The cookie-parser middleware hasn't been configured yet.
cookieParserMiddleware(req, res, function() {
_middleware(req, res, next);
nextMiddleware(req, res, next);
});
return;
}
_middleware(req, res, next);
nextMiddleware(req, res, next);
}

@@ -41,2 +54,9 @@

function getHeader(req, name) {
if (req.headers) {
return req.headers['user-agent'];
}
return req.get('user-agent');
}
function _middleware(req, res, next) {

@@ -91,2 +111,3 @@ var linkProbability = RELINK_PROBABILITY;

console.log(req.headers);
cb(null, {

@@ -96,3 +117,3 @@ $endpointURL: req.path,

$localMachineID: localMachineID,
$userAgent: req.get('user-agent')
$userAgent: getHeader(req, 'user-agent')
});

@@ -99,0 +120,0 @@ }

4

package.json
{
"name": "authbox",
"version": "0.3.0",
"version": "0.6.0",
"description": "",

@@ -15,5 +15,7 @@ "main": "lib/index.js",

"bluebird": "^2.3.2",
"connect": "^3.3.3",
"connect-inject": "petehunt/connect-inject",
"cookie-parser": "^1.3.3",
"request": "^2.47.0",
"response-cookie": "0.0.2",
"sha256": "^0.1.1"

@@ -20,0 +22,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