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

express-jwt

Package Overview
Dependencies
Maintainers
51
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-jwt - npm Package Compare versions

Comparing version 8.3.0 to 8.4.0

dist/util/set.d.ts

5

dist/index.d.ts

@@ -1,2 +0,3 @@

import jwt from 'jsonwebtoken';
/// <reference types="node" />
import * as jwt from 'jsonwebtoken';
import * as express from 'express';

@@ -90,4 +91,4 @@ import { unless } from 'express-unless';

export declare const expressjwt: (options: Params) => {
(req: express.Request, res: express.Response, next: express.NextFunction): Promise<any>;
(req: express.Request, res: express.Response, next: express.NextFunction): Promise<void | NodeJS.Immediate>;
unless: typeof unless;
};

@@ -38,10 +38,7 @@ "use strict";

};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.expressjwt = exports.UnauthorizedError = void 0;
var jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
var jwt = require("jsonwebtoken");
var express_unless_1 = require("express-unless");
var lodash_set_1 = __importDefault(require("lodash.set"));
var set_1 = require("./util/set");
var UnauthorizedError_1 = require("./errors/UnauthorizedError");

@@ -126,3 +123,3 @@ var UnauthorizedError_2 = require("./errors/UnauthorizedError");

try {
decodedToken = jsonwebtoken_1.default.decode(token, { complete: true });
decodedToken = jwt.decode(token, { complete: true });
}

@@ -138,3 +135,3 @@ catch (err) {

_b.trys.push([5, 6, , 10]);
jsonwebtoken_1.default.verify(token, key, options);
jwt.verify(token, key, options);
return [3 /*break*/, 10];

@@ -144,3 +141,3 @@ case 6:

wrappedErr = new UnauthorizedError_1.UnauthorizedError('invalid_token', err_1);
if (!(err_1 instanceof jsonwebtoken_1.default.TokenExpiredError && typeof options.onExpired === 'function')) return [3 /*break*/, 8];
if (!(err_1 instanceof jwt.TokenExpiredError && typeof options.onExpired === 'function')) return [3 /*break*/, 8];
return [4 /*yield*/, options.onExpired(req, wrappedErr)];

@@ -165,3 +162,3 @@ case 7:

request = req;
(0, lodash_set_1.default)(request, requestProperty, decodedToken.payload);
(0, set_1.set)(request, requestProperty, decodedToken.payload);
setImmediate(next);

@@ -168,0 +165,0 @@ return [3 /*break*/, 14];

8

package.json
{
"name": "express-jwt",
"version": "8.3.0",
"version": "8.4.0",
"description": "JWT authentication middleware.",

@@ -38,8 +38,6 @@ "keywords": [

"express-unless": "^2.1.3",
"jsonwebtoken": "^9.0.0",
"lodash.set": "^4.3.2"
"jsonwebtoken": "^9.0.0"
},
"devDependencies": {
"@types/lodash": "^4.14.191",
"@types/lodash.set": "^4.3.7",
"@types/express": "^4.17.16",
"@types/mocha": "^9.1.0",

@@ -46,0 +44,0 @@ "@typescript-eslint/eslint-plugin": "^5.15.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