Skip to content

Commit

Permalink
Allow use of OpenID auths in dev env.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zren committed Jun 14, 2014
1 parent c665e5f commit a6a6c0a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
10 changes: 4 additions & 6 deletions controllers/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@ var openIdStrategies = {};
Strategy.find({}, function (err, strategies) {

// Get OpenId strategies
if (process.env.NODE_ENV === 'production') {
for (var name in allStrategies) {
if (!allStrategies[name].oauth) {
openIdStrategies[name] = true;
strategies.push({ 'name' : name, 'openid' : true });
}
for (var name in allStrategies) {
if (!allStrategies[name].oauth) {
openIdStrategies[name] = true;
strategies.push({ 'name' : name, 'openid' : true });
}
}

Expand Down
18 changes: 8 additions & 10 deletions controllers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,16 +197,14 @@ exports.register = function (req, res) {
options.strategies = [];

// Get OpenId strategies
if (process.env.NODE_ENV === 'production') {
_.each(strategies, function(strategy, strategyKey){
if (!strategy.oauth) {
options.strategies.push({
'strat': strategyKey,
'display': strategy.name
});
}
});
}
_.each(strategies, function(strategy, strategyKey){
if (!strategy.oauth) {
options.strategies.push({
'strat': strategyKey,
'display': strategy.name
});
}
});

//--- Tasks

Expand Down

0 comments on commit a6a6c0a

Please sign in to comment.