From bbf0b7459f6fb98b39f8ea8d70ce1cd9ec79fce3 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Mon, 11 Jan 2016 14:26:05 +0100 Subject: [PATCH] Allow to set an alternative endpoint for auth --- app/services/auth.js | 2 +- config/environment.js | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/services/auth.js b/app/services/auth.js index dbea5d72..0487cfef 100644 --- a/app/services/auth.js +++ b/app/services/auth.js @@ -20,7 +20,7 @@ export default Ember.Service.extend({ }, endpoint: function() { - return config.apiEndpoint; + return config.authEndpoint || config.apiEndpoint; }.property(), signOut: function() { diff --git a/config/environment.js b/config/environment.js index 0e09d00c..e88cd3bc 100644 --- a/config/environment.js +++ b/config/environment.js @@ -61,6 +61,14 @@ module.exports = function(environment) { terms: ENV.billingEndpoint + "/pages/terms" }; } + + if (process.env.API_ENDPOINT) { + ENV.apiEndpoint = process.env.API_ENDPOINT; + } + + if (process.env.AUTH_ENDPOINT) { + ENV.authEndpoint = process.env.AUTH_ENDPOINT; + } } if (environment === 'development') {