From 31adf7084dc984fdcabb2ad7c934979636f621d8 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Wed, 4 Jun 2014 18:54:41 -0400 Subject: [PATCH] filter:register.complete - plugins can redirect the user elsewhere post-registration --- src/routes/authentication.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/routes/authentication.js b/src/routes/authentication.js index a157520b8f..7c28602860 100644 --- a/src/routes/authentication.js +++ b/src/routes/authentication.js @@ -83,7 +83,7 @@ if(meta.config.allowRegistration !== undefined && parseInt(meta.config.allowRegistration, 10) === 0) { return res.send(403); } - + var userData = {}; for (var key in req.body) { @@ -109,11 +109,13 @@ require('../socket.io').emitUserCount(); - if(req.body.referrer) { - res.redirect(req.body.referrer); - } else { - res.redirect(nconf.get('relative_path') + '/'); - } + plugins.fireHook('filter:register.complete', uid, req.body.referrer, function(err, uid, destination) { + if(destination) { + res.redirect(destination); + } else { + res.redirect(nconf.get('relative_path') + '/'); + } + }); }); }); });