From 28d86279dcff6b3d29ea9822fbb6fe249bd2b995 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Mon, 28 Dec 2020 14:45:32 -0800 Subject: [PATCH] Fixed exception when userinfo not received. --- views/default.handlebars | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/views/default.handlebars b/views/default.handlebars index 73c41f75..2edc3021 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -1936,10 +1936,12 @@ // Return the number of 2nd factor for this account function count2factoraAuths() { var authFactorCount = 0; - if (userinfo.otpsecret == 1) { authFactorCount++; } // Authenticator time factor + if (userinfo != null) { + if (userinfo.otpsecret == 1) { authFactorCount++; } // Authenticator time factor + if (userinfo.otphkeys != null) { authFactorCount += userinfo.otphkeys; } // FIDO hardware factor + } if ((features & 0x00800000) && (userinfo.otpekey == 1)) { authFactorCount++; } // EMail factor if ((features & 0x04000000) && (userinfo.phone != null)) { authFactorCount++; } // SMS factor - if (userinfo.otphkeys != null) { authFactorCount += userinfo.otphkeys; } // FIDO hardware factor if ((authFactorCount > 0) && (userinfo.otpkeys == 1)) { authFactorCount++; } // Backup keys return authFactorCount; }