From f6838ef51e3b426124095db51a8f4b2acd518dd9 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Mon, 23 Jun 2014 10:20:23 -0400 Subject: [PATCH] only use passport.authenticate if a strategy url is defined --- src/routes/authentication.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/routes/authentication.js b/src/routes/authentication.js index 142c72bada..1cd4331fb4 100644 --- a/src/routes/authentication.js +++ b/src/routes/authentication.js @@ -148,9 +148,11 @@ for (var i in login_strategies) { if (login_strategies.hasOwnProperty(i)) { var strategy = login_strategies[i]; - app.get(strategy.url, passport.authenticate(strategy.name, { - scope: strategy.scope - })); + if (strategy.url) { + app.get(strategy.url, passport.authenticate(strategy.name, { + scope: strategy.scope + })); + } app.get(strategy.callbackURL, passport.authenticate(strategy.name, { successRedirect: nconf.get('relative_path') + '/',