From 53afa552d03cf0090d24f967ae5114779851af25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 11 Dec 2017 11:40:42 -0500 Subject: [PATCH] closes #6162 --- src/controllers/authentication.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/controllers/authentication.js b/src/controllers/authentication.js index c6b418ff9b..b2d46dcd70 100644 --- a/src/controllers/authentication.js +++ b/src/controllers/authentication.js @@ -57,6 +57,10 @@ authenticationController.register = function (req, res) { user.isPasswordValid(userData.password, next); }, function (next) { + res.locals.processLogin = true; // set it to false in plugin if you wish to just register only + plugins.fireHook('filter:register.check', { req: req, res: res, userData: userData }, next); + }, + function (result, next) { registerAndLoginUser(req, res, userData, next); }, ], function (err, data) { @@ -100,8 +104,7 @@ function registerAndLoginUser(req, res, userData, callback) { user.shouldQueueUser(req.ip, next); }, function (queue, next) { - res.locals.processLogin = true; // set it to false in plugin if you wish to just register only - plugins.fireHook('filter:register.check', { req: req, res: res, userData: userData, queue: queue }, next); + plugins.fireHook('filter:register.shouldQueue', { req: req, res: res, userData: userData, queue: queue }, next); }, function (data, next) { if (data.queue) {