From 9ff5148a5d4884d481826d4662bdc7f2f0efbb5a Mon Sep 17 00:00:00 2001 From: Randy Otero Date: Mon, 10 Jun 2024 10:17:48 +0100 Subject: [PATCH] Update jwtConsole.js The response of the function requestJWTUserToken is not returning a body variable inside it, but rather the data variable that is used to generate a link that can be opened in the browser data: { error: 'consent_required' } This bug generates a 400 error when executing the example code so the authentication process cannot be completed. Signed-off-by: Randy Otero --- jwt_console_project/jwtConsole.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jwt_console_project/jwtConsole.js b/jwt_console_project/jwtConsole.js index 23665e9c..67c15ac1 100644 --- a/jwt_console_project/jwtConsole.js +++ b/jwt_console_project/jwtConsole.js @@ -62,7 +62,7 @@ async function authenticate(){ }; } catch (e) { console.log(e); - let body = e.response && e.response.body; + let body = e.response && e.response.data; // Determine the source of the error if (body) { // The user needs to grant consent