Skip to content

Commit

Permalink
Merge pull request #126 from zooniverse/config-oauth-host
Browse files Browse the repository at this point in the history
Change default oAuth Host and allow config
  • Loading branch information
shaunanoordin authored Feb 20, 2020
2 parents 085a94a + 1bcb3d2 commit 6254ca7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var API_APPLICATION_IDS = {
};

var OAUTH_HOSTS = {
production: 'https://panoptes.zooniverse.org',
production: 'https://www.zooniverse.org',
staging: 'https://panoptes-staging.zooniverse.org',
development: 'https://panoptes-staging.zooniverse.org',
test: 'https://panoptes-staging.zooniverse.org'
Expand Down Expand Up @@ -47,12 +47,14 @@ var appFromBrowser = locationMatch(/\W?panoptes-api-application=([^&]+)/);
var talkFromBrowser = locationMatch(/\W?talk-host=([^&]+)/);
var sugarFromBrowser = locationMatch(/\W?sugar-host=([^&]+)/);
var statFromBrowser = locationMatch(/\W?stat-host=([^&]+)/);
var oauthFromBrowser = locationMatch(/\W?oauth-host=([^&]+)/);

var hostFromShell = process.env.PANOPTES_API_HOST;
var appFromShell = process.env.PANOPTES_API_APPLICATION;
var talkFromShell = process.env.TALK_HOST;
var sugarFromShell = process.env.SUGAR_HOST;
var statFromShell = process.env.STAT_HOST;
var oauthFromShell = process.env.OAUTH_HOST;

var envFromBrowser = locationMatch(/\W?env=(\w+)/);
var envFromShell = process.env.NODE_ENV;
Expand Down Expand Up @@ -92,7 +94,7 @@ module.exports = {
talkHost: talkFromBrowser || talkFromShell || TALK_HOSTS[env],
sugarHost: sugarFromBrowser || sugarFromShell || SUGAR_HOSTS[env],
statHost: statFromBrowser || statFromShell || STAT_HOSTS[env],
oauthHost: OAUTH_HOSTS[env],
oauthHost: oauthFromBrowser || oauthFromShell || OAUTH_HOSTS[env],
params: defaultParams,
jsonHeaders: JSON_HEADERS
};
Expand Down

0 comments on commit 6254ca7

Please sign in to comment.