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

nestjs-jwt2

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nestjs-jwt2 - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

4

lib/guards/jwt.guard.js

@@ -28,7 +28,7 @@ "use strict";

if (!tokenHeader) {
throw new common_1.UnauthorizedException();
throw new common_1.UnauthorizedException('No token provided');
}
const tokens = tokenHeader.split(' ');
if (tokens.length !== 2) {
throw new common_1.UnauthorizedException();
throw new common_1.UnauthorizedException('No token found');
}

@@ -35,0 +35,0 @@ try {

export declare class JwtService {
private readonly client;
private readonly cert;
private readonly audiences;
private readonly audiences?;
private readonly issuers;

@@ -6,0 +6,0 @@ constructor();

@@ -23,5 +23,2 @@ "use strict";

}
if (!process.env.JWT_AUDIENCES) {
throw new Error('You must provide JWT_AUDIENCES environment variable');
}
if (!process.env.JWT_ISSUER) {

@@ -33,6 +30,3 @@ throw new Error('You must provide JWT_ISSUER environment variable');

try {
if (certPath) {
this.cert = fs.readFileSync(certPath);
}
else {
if (jwksUri) {
this.client = jwksClient({

@@ -45,2 +39,5 @@ jwksUri,

}
else {
this.cert = fs.readFileSync(certPath);
}
}

@@ -55,3 +52,3 @@ catch (e) {

jwt.verify(token, certOrGetKey, {
audience: this.audiences,
audience: this.audiences || [],
issuer: this.issuers,

@@ -58,0 +55,0 @@ }, err => {

{
"name": "nestjs-jwt2",
"version": "1.1.0",
"version": "1.1.1",
"description": "Jwt utils for nestjs",

@@ -5,0 +5,0 @@ "author": "Julien Dufresne",

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