mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +01:00
WIP registration interstitial
This commit is contained in:
@@ -81,6 +81,23 @@ authenticationController.register = function(req, res, next) {
|
||||
function registerAndLoginUser(req, res, userData, callback) {
|
||||
var uid;
|
||||
async.waterfall([
|
||||
function(next) {
|
||||
plugins.fireHook('filter:register.interstitial', {
|
||||
userData: userData,
|
||||
interstitials: []
|
||||
}, function(err, data) {
|
||||
// If interstitials are found, save registration attempt into session and abort
|
||||
var deferRegistration = data.interstitials.length;
|
||||
deferRegistration = true;
|
||||
|
||||
if (!deferRegistration) {
|
||||
return next();
|
||||
} else {
|
||||
req.session.registration = userData;
|
||||
return res.json({ referrer: nconf.get('relative_path') + '/register/complete' });
|
||||
}
|
||||
});
|
||||
},
|
||||
function(next) {
|
||||
user.create(userData, next);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user