nestjs-jwt2
Advanced tools
Comparing version 1.0.2-beta to 1.0.3-beta
export declare class JwtService { | ||
private readonly cert; | ||
private readonly audiences; | ||
private readonly issuers; | ||
constructor(); | ||
@@ -4,0 +6,0 @@ validateToken(token: string): Promise<boolean>; |
@@ -29,2 +29,10 @@ "use strict"; | ||
} | ||
if (!process.env.JWT_AUDIENCES) { | ||
throw new Error('You must provide JWT_AUDIENCES environment variable'); | ||
} | ||
if (!process.env.JWT_ISSUER) { | ||
throw new Error('You must provide JWT_ISSUER environment variable'); | ||
} | ||
this.audiences = process.env.JWT_AUDIENCES.split(' '); | ||
this.issuers = process.env.JWT_ISSUER.split(' '); | ||
try { | ||
@@ -39,3 +47,6 @@ this.cert = fs.readFileSync(certPath); | ||
return new Promise((resolve, reject) => { | ||
jwt.verify(token, this.cert, err => { | ||
jwt.verify(token, this.cert, { | ||
audience: this.audiences, | ||
issuer: this.issuers | ||
}, err => { | ||
if (err) { | ||
@@ -42,0 +53,0 @@ reject(); |
{ | ||
"name": "nestjs-jwt2", | ||
"version": "1.0.2-beta", | ||
"version": "1.0.3-beta", | ||
"description": "Jwt utils for nestjs", | ||
@@ -5,0 +5,0 @@ "author": "Julien Dufresne", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15501
20
269
7