From 079f134aa92610618209b4bb45e5acc847f7b01e Mon Sep 17 00:00:00 2001 From: Rick Watson Date: Mon, 6 May 2019 21:46:28 +0100 Subject: [PATCH] resolve issue with test endpoint --- src/SecurityManager.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/SecurityManager.cpp b/src/SecurityManager.cpp index f164d12..3a1ecae 100644 --- a/src/SecurityManager.cpp +++ b/src/SecurityManager.cpp @@ -101,10 +101,11 @@ void SecurityManager::signIn(AsyncWebServerRequest *request, JsonDocument &jsonD void SecurityManager::testVerification(AsyncWebServerRequest *request, JsonDocument &jsonDocument){ if (jsonDocument.is()) { String accessToken = jsonDocument["access_token"]; - DynamicJsonDocument parsedJwt(MAX_JWT_SIZE); - if (jwtHandler.parseJWT(accessToken, parsedJwt)){ + DynamicJsonDocument parsedJwt(MAX_JWT_SIZE); + jwtHandler.parseJWT(accessToken, parsedJwt); + if (parsedJwt.is()){ String username = parsedJwt["username"]; - + Serial.println(username); } } // authentication failed