From bab88893f195e6a686073dcefbe51e3b80ccb3b3 Mon Sep 17 00:00:00 2001 From: Aziz Khoury Date: Thu, 15 May 2014 03:10:15 -0400 Subject: [PATCH] changing 'filter:register.check' hook signature to provide req, res and data --- src/routes/authentication.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/routes/authentication.js b/src/routes/authentication.js index b203952b99..c008dd2b80 100644 --- a/src/routes/authentication.js +++ b/src/routes/authentication.js @@ -73,13 +73,12 @@ var userData = { username: req.body.username, password: req.body.password, - email: req.body.email, - ip: req.ip + email: req.body.email }; - plugins.fireHook('filter:register.check', userData, function(err, userData) { + plugins.fireHook('filter:register.check', req, res, userData, function(err, userData) { if (err) { - return res.redirect(nconf.get('relative_path') + '/register'); + return res.redirect(nconf.get('relative_path') + '/register' + (err.message ? '?error=' + err.message : '')); } user.create(userData, function(err, uid) {