From cba6ccc220e38d6d9d542355191cbdc03c9d7076 Mon Sep 17 00:00:00 2001 From: Karim Hamidou Date: Fri, 29 Apr 2016 10:18:51 -0700 Subject: [PATCH] [N1] Changes to allow running edgehill-server locally Summary: This is mostly config changes. Test Plan: Tested the Google OAuth flow. Reviewers: bengotow, drew Reviewed By: bengotow, drew Differential Revision: https://phab.nylas.com/D2907 --- internal_packages/onboarding/lib/account-choose-page.cjsx | 8 +++++++- internal_packages/onboarding/lib/token-auth-api.coffee | 2 +- internal_packages/thread-snooze/package.json | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/internal_packages/onboarding/lib/account-choose-page.cjsx b/internal_packages/onboarding/lib/account-choose-page.cjsx index 8844a5344..bdda69d8d 100644 --- a/internal_packages/onboarding/lib/account-choose-page.cjsx +++ b/internal_packages/onboarding/lib/account-choose-page.cjsx @@ -90,13 +90,19 @@ class AccountChoosePage extends React.Component code = NylasEnv.config.get('invitationCode') || '' state = [provider.clientKey,@_base64url(provider.encryptionKey),@_base64url(provider.encryptionIv),code].join(',') + # Use a different app for production and development. + env = NylasEnv.config.get('env') || 'production' + google_client_id = '372024217839-cdsnrrqfr4d6b4gmlqepd7v0n0l0ip9q.apps.googleusercontent.com' + if env != 'production' + google_client_id = '529928329786-e5foulo1g9kiej2h9st9sb0f4dt96s6v.apps.googleusercontent.com' + googleUrl = url.format({ protocol: 'https' host: 'accounts.google.com/o/oauth2/auth' query: response_type: 'code' state: state - client_id: '372024217839-cdsnrrqfr4d6b4gmlqepd7v0n0l0ip9q.apps.googleusercontent.com' + client_id: google_client_id redirect_uri: "#{EdgehillAPI.APIRoot}/oauth/google/callback" access_type: 'offline' scope: 'https://www.googleapis.com/auth/userinfo.email \ diff --git a/internal_packages/onboarding/lib/token-auth-api.coffee b/internal_packages/onboarding/lib/token-auth-api.coffee index 6c62b5f65..42c23d5bd 100644 --- a/internal_packages/onboarding/lib/token-auth-api.coffee +++ b/internal_packages/onboarding/lib/token-auth-api.coffee @@ -11,7 +11,7 @@ class TokenAuthAPI _onConfigChanged: => env = NylasEnv.config.get('env') if env is 'development' - @APIRoot = "http://localhost:6001" + @APIRoot = "http://localhost:5000" else if env in ['experimental', 'staging'] @APIRoot = "https://invite-staging.nylas.com" else diff --git a/internal_packages/thread-snooze/package.json b/internal_packages/thread-snooze/package.json index be5540069..3778ba4b2 100644 --- a/internal_packages/thread-snooze/package.json +++ b/internal_packages/thread-snooze/package.json @@ -2,6 +2,7 @@ "name": "thread-snooze", "version": "1.0.0", "appId": { + "development": "4iyhn0iqje4n9nkn8iaoyke30", "staging": "2bfvqp9ylcl1az76od31qmny", "production": "86bu9juw5bjeq1c8y2679aary" },