From 61fa88d5a1ae8977e327326dde8c46f2ecacbf45 Mon Sep 17 00:00:00 2001 From: Jorge Miguel Lobo Escalona Date: Mon, 13 Jun 2022 19:20:14 +0200 Subject: [PATCH] B #5819: 2FA login FireEdge (#2147) --- src/fireedge/src/server/routes/api/auth/utils.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/fireedge/src/server/routes/api/auth/utils.js b/src/fireedge/src/server/routes/api/auth/utils.js index c5b11edf51..5541d4419a 100644 --- a/src/fireedge/src/server/routes/api/auth/utils.js +++ b/src/fireedge/src/server/routes/api/auth/utils.js @@ -252,17 +252,13 @@ const updaterResponse = (code) => { */ const validate2faAuthentication = (informationUser) => { let rtn = false - if ( - informationUser.TEMPLATE && - informationUser.TEMPLATE.SUNSTONE && - informationUser.TEMPLATE.SUNSTONE[default2FAOpennebulaVar] - ) { + if (informationUser?.TEMPLATE?.SUNSTONE?.[default2FAOpennebulaVar]) { /********************************************************* * Validate 2FA *********************************************************/ if (tfatoken.length <= 0) { - updaterResponse(httpResponse(accepted)) + updaterResponse(httpResponse(accepted, { id: informationUser?.ID })) } else { const secret = informationUser.TEMPLATE.SUNSTONE[default2FAOpennebulaVar] if (!check2Fa(secret, tfatoken)) {