From 0c119de796d975e84b74aea3293bc7adcb13c8e1 Mon Sep 17 00:00:00 2001 From: Nerveyyyy Date: Tue, 30 Jul 2024 11:46:04 +0100 Subject: [PATCH] Fixed onUserInfoResponse chunks being overridden --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 24b9fa9..8490081 100644 --- a/index.js +++ b/index.js @@ -485,7 +485,7 @@ function fastifyOauth2 (fastify, options, next) { function onUserinfoResponse (res) { let rawData = '' - res.on('data', (chunk) => { rawData = chunk }) + res.on('data', (chunk) => { rawData += chunk }) res.on('end', () => { try { cb(null, JSON.parse(rawData)) // should always be JSON since we don't do jwt auth response