aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDennis Eriksen <dennis.se@gmail.com>2013-05-15 11:33:37 +0200
committerDennis Eriksen <dennis.se@gmail.com>2013-05-15 11:33:37 +0200
commit48da5b0e58467ca1331a0ef5e2d32963e2e8da24 (patch)
tree1f4547faf0fc63267f7eb08d3f0f4bad1289024b
parentfacebook now uses users.authCallback as callback, like it should. (diff)
downloadDivid-48da5b0e58467ca1331a0ef5e2d32963e2e8da24.tar.gz
authCallback now checks for user email
-rw-r--r--controllers/users.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/controllers/users.js b/controllers/users.js
index f3568a4..477a85a 100644
--- a/controllers/users.js
+++ b/controllers/users.js
@@ -83,6 +83,9 @@ exports.create = function(req, res) {
*/
exports.authCallback = function(req, res, next) {
+ // if the user hasn't registered an email, we need to do so
+ if (!req.user.email || req.user.email === 'undefined') return res.redirect('/registerEmail');
+
res.redirect('/dashboard');
}