Skip to content

Commit

Permalink
Update ws.guard.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
ChakshuGautam authored Mar 29, 2023
1 parent 79b4bc4 commit 20649eb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/guard/ws.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ import * as jwt from 'jsonwebtoken';
// eslint-disable-next-line @typescript-eslint/no-var-requires
const jwksClient = require('jwks-rsa');

const getKey = (header, callback) => {
const client = jwksClient({
const client = jwksClient({
jwksUri: 'http://103.154.251.109:9011/.well-known/jwks.json',
requestHeaders: {}, // Optional
timeout: 30000, // Defaults to 30s
});
});

const getKey = (header, callback) => {
client.getSigningKey(header.kid, function (err, key) {
const signingKey = key.publicKey || key.rsaPublicKey;
callback(null, signingKey);
Expand Down

0 comments on commit 20649eb

Please sign in to comment.