fix: onSuccessfulLogin not working

In scenarios where onSuccessfulLogin was not called in the SSO plugin,
core's calling of onSuccessfulLogin was prematurely returning, because
it was checking the wrong value.

This commit fixes the issue by checking a different value.
v1.18.x
Julian Lam 5 years ago
parent 0ae1eb4f6e
commit 111ed802cf

@ -316,8 +316,12 @@ authenticationController.doLogin = async function (req, uid) {
};
authenticationController.onSuccessfulLogin = async function (req, uid) {
// If already called once, return prematurely
if (req.res.locals.user) {
/*
* Older code required that this method be called from within the SSO plugin.
* That behaviour is no longer required, onSuccessfulLogin is now automatically
* called in NodeBB core. However, if already called, return prematurely
*/
if (req.loggedIn) {
return true;
}

Loading…
Cancel
Save