Fixed handleStrategyLogin() server exception.

This commit is contained in:
Ylian Saint-Hilaire 2022-10-26 14:45:22 -07:00
parent 7f986bd7c4
commit 6f234f83fc
1 changed files with 3 additions and 3 deletions

View File

@ -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 = [];