mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-20 23:40:38 +01:00
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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user