From 6f234f83fc636168ff83be0fba2538337761c487 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Wed, 26 Oct 2022 14:45:22 -0700 Subject: [PATCH] Fixed handleStrategyLogin() server exception. --- webserver.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webserver.js b/webserver.js index 46a542e9..c2985911 100644 --- a/webserver.js +++ b/webserver.js @@ -2573,10 +2573,10 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF // This is called after a successful Oauth to Twitter, Google, GitHub... function handleStrategyLogin(req, res) { const domain = checkUserIpAddress(req, res); - const authStrategy = req.user.strategy if (domain == null) { return; } - parent.debug('authlog', `${authStrategy.toUpperCase()}: Verified user: ${JSON.stringify(req.user, null, 4)}` + JSON.stringify(req.user)); - if ((req.user != null) && (req.user.sid != null)) { + if ((req.user != null) && (req.user.sid != null) && (req.user.strategy != null)) { + const authStrategy = req.user.strategy + parent.debug('authlog', `${authStrategy.toUpperCase()}: Verified user: ${JSON.stringify(req.user, null, 4)}` + JSON.stringify(req.user)); // Check if any group related options exist var userMemberships = [];