New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ewd-session

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ewd-session - npm Package Compare versions

Comparing version 2.11.0 to 2.12.0

51

lib/session.js

@@ -6,3 +6,3 @@ /*

| |
| Copyright (c) 2016 M/Gateway Developments Ltd, |
| Copyright (c) 2016-17 M/Gateway Developments Ltd, |
| Reigate, Surrey UK. |

@@ -28,3 +28,3 @@ | All rights reserved. |

7 December 2016
20 March 2017

@@ -222,2 +222,48 @@ */

function httpAuthenticate(httpHeaders, credentials) {
var cookie = httpHeaders.cookie;
var authorization = httpHeaders.authorization;
if (!cookie && !authorization) {
return {
error: 'Missing Authorization or Cookie Header',
status: {
code: 403,
text: 'Forbidden'
}
};
}
var credentials = credentials || {
authorization: 'QEWD token',
cookie: 'QEWDTOKEN'
};
var token;
if (authorization) {
// authorization, if present, over-rides cookie
token = authorization.split(credentials.authorization + '=')[1];
}
else {
var pieces = cookie.split(';');
pieces.forEach(function(piece) {
if (piece.indexOf(credentials.cookie) !== -1) {
token = piece.split(credentials.cookie + '=')[1];
}
});
}
if (!token || token === '') {
return {
error: 'Missing or Empty QEWD Session Token',
status: {
code: 403,
text: 'Forbidden'
}
};
}
return tokenAuthenticate(token, 'noCheck');
}
function getActiveSessions() {

@@ -250,4 +296,5 @@ var sessions = [];

authenticate: tokenAuthenticate,
httpAuthenticate: httpAuthenticate,
active: getActiveSessions,
byToken: getSessionByToken
};

2

package.json
{
"name": "ewd-session",
"version": "2.11.0",
"version": "2.12.0",
"description": "Session management using ewd-document-store DocumentNodes",

@@ -5,0 +5,0 @@ "main": "index.js",

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