Skip to content

Commit

Permalink
fix: ensure SQL processor uses key returned by query
Browse files Browse the repository at this point in the history
  • Loading branch information
ncc-akis committed Jan 13, 2025
1 parent 5b777ef commit b975cb5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/auth/jwt/jwt.token.with.sql.kid.processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> {
Expand Down

0 comments on commit b975cb5

Please sign in to comment.