1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

B #5819: 2FA login FireEdge (#2147)

This commit is contained in:
Jorge Miguel Lobo Escalona 2022-06-13 19:20:14 +02:00 committed by GitHub
parent 549dbf41c9
commit 61fa88d5a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)) {