Socket
Socket
Sign inDemoInstall

koa-jwt

Package Overview
Dependencies
21
Maintainers
2
Versions
47
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.5.1 to 3.6.0

3

lib/index.js

@@ -69,2 +69,5 @@ 'use strict';

ctx.throw(401, msg, { originalError: e });
}else{
//lets downstream middlewares handle JWT exceptions
ctx.state.jwtOriginalError = e;
}

@@ -71,0 +74,0 @@ }

4

package.json
{
"name": "koa-jwt",
"version": "3.5.1",
"version": "3.6.0",
"description": "Koa JWT authentication middleware.",

@@ -43,3 +43,3 @@ "types": "types/index.d.ts",

"dependencies": {
"jsonwebtoken": "8.3.0",
"jsonwebtoken": "8.5.1",
"koa-unless": "1.0.7",

@@ -46,0 +46,0 @@ "p-any": "1.1.0"

@@ -197,3 +197,3 @@ # koa-jwt

This lets downstream middleware make decisions based on whether `ctx.state.user` is set.
This lets downstream middleware make decisions based on whether `ctx.state.user` is set. You can still handle errors using `ctx.state.jwtOriginalError`.

@@ -231,3 +231,3 @@ If you prefer to use another ctx key for the decoded data, just pass in `key`, like so:

Notifying a client of error codes (e.g token expiration) can be achieved by sending the `err.originalError.message` error code to the client.
Notifying a client of error codes (e.g token expiration) can be achieved by sending the `err.originalError.message` error code to the client. If passthrough is enabled use `ctx.state.jwtOriginalError`.

@@ -234,0 +234,0 @@ ```js

@@ -22,3 +22,3 @@ // Type definitions for koa-jwt 2.x

debug?: boolean;
audience?: string;
audience?: string | string[];
issuer?: string;

@@ -31,4 +31,4 @@ algorithms?: string[];

export interface Middleware extends Koa.Middleware {
unless(params?: any): any;
unless(params?: { path: RegExp[] }): Koa.Middleware;
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc