From 98368bbb6a43be6f9666b3057a50ff189b9c52cc Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 24 Jun 2016 18:40:32 -0400 Subject: [PATCH] if interstitials don't pass any errors back but some still exist, redirect properly --- src/controllers/authentication.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/controllers/authentication.js b/src/controllers/authentication.js index cea396c522..c34b0acd0a 100644 --- a/src/controllers/authentication.js +++ b/src/controllers/authentication.js @@ -94,7 +94,11 @@ function registerAndLoginUser(req, res, userData, callback) { } else { userData.register = true; req.session.registration = userData; - return res.json({ referrer: nconf.get('relative_path') + '/register/complete' }); + if (res.locals.isAPI) { + return res.json({ referrer: nconf.get('relative_path') + '/register/complete' }); + } else { + return res.redirect(nconf.get('relative_path') + '/register/complete'); + } } }); },