From b975cb5fae1845c3effd9b8bd1ed53592ef0f709 Mon Sep 17 00:00:00 2001 From: Andrew Kisliakov Date: Mon, 13 Jan 2025 10:57:07 +0000 Subject: [PATCH] fix: ensure SQL processor uses key returned by query --- src/auth/jwt/jwt.token.with.sql.kid.processor.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/auth/jwt/jwt.token.with.sql.kid.processor.ts b/src/auth/jwt/jwt.token.with.sql.kid.processor.ts index d039a59d..da8a4cdb 100644 --- a/src/auth/jwt/jwt.token.with.sql.kid.processor.ts +++ b/src/auth/jwt/jwt.token.with.sql.kid.processor.ts @@ -28,10 +28,10 @@ export class JwtTokenWithSqlKIDProcessor extends JwtTokenProcessor { this.log.debug(`Executing key fetching query: ${query}`); const keyRow: { key: string } = await this.em .getConnection() - .execute(query); + .execute(query, [], 'get'); this.log.debug(`Key is ${keyRow.key}`); - return decode(token, this.key, false, 'HS256'); + return decode(token, keyRow.key, false, 'HS256'); } async createToken(payload: unknown): Promise {