diff --git a/CHANGELOG.md b/CHANGELOG.md index e3038ff6dc..37ac7ed189 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,19 @@ +#### v2.4.4 (2022-08-18) + +##### Chores + +* incrementing version number - v2.4.3 (9c647c6c) +* update changelog for v2.4.3 (06da15a5) +* incrementing version number - v2.4.2 (3aa7b855) +* incrementing version number - v2.4.1 (60cbd148) +* incrementing version number - v2.4.0 (4834cde3) +* incrementing version number - v2.3.1 (d2425942) +* incrementing version number - v2.3.0 (046ea120) + +##### Bug Fixes + +* missing req, closes #10847 (489fb3a3) + #### v2.4.3 (2022-08-18) ##### Chores diff --git a/src/api/users.js b/src/api/users.js index aa1ea25687..abc295acfd 100644 --- a/src/api/users.js +++ b/src/api/users.js @@ -305,7 +305,7 @@ async function isPrivilegedOrSelfAndPasswordMatch(caller, data) { async function processDeletion({ uid, method, password, caller }) { const isTargetAdmin = await user.isAdministrator(uid); - const isSelf = parseInt(uid, 10) === caller.uid; + const isSelf = parseInt(uid, 10) === parseInt(caller.uid, 10); const isAdmin = await user.isAdministrator(caller.uid); if (isSelf && meta.config.allowAccountDelete !== 1) { diff --git a/src/routes/authentication.js b/src/routes/authentication.js index b3f9bcba40..3c6ea76f0b 100644 --- a/src/routes/authentication.js +++ b/src/routes/authentication.js @@ -25,6 +25,20 @@ Auth.initialize = function (app, middleware) { Auth.app = app; Auth.middleware = middleware; + + // Apply wrapper around passport.authenticate to pass in keepSessionInfo option + const _authenticate = passport.authenticate; + passport.authenticate = (strategy, options, callback) => { + if (!callback && typeof options === 'function') { + return _authenticate.call(passport, strategy, options); + } + + if (!options.hasOwnProperty('keepSessionInfo')) { + options.keepSessionInfo = true; + } + + return _authenticate.call(passport, strategy, options, callback); + }; }; Auth.setAuthVars = function setAuthVars(req) {