From 20649eb919b3079248478d7309b2493d9614be83 Mon Sep 17 00:00:00 2001 From: Chakshu Gautam Date: Wed, 29 Mar 2023 15:54:27 +0530 Subject: [PATCH] Update ws.guard.ts --- src/guard/ws.guard.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/guard/ws.guard.ts b/src/guard/ws.guard.ts index 9ad893d..4dbc406 100644 --- a/src/guard/ws.guard.ts +++ b/src/guard/ws.guard.ts @@ -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);