Skip to content

Commit

Permalink
🐛 fixed protocol issues with the Client and API env vars urls
Browse files Browse the repository at this point in the history
  • Loading branch information
razvanilin committed Jul 5, 2021
1 parent 1e41a42 commit 07f5d4c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .env-template
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ CB_API_HOST_DEV=localhost
CB_API_PORT_DEV=3210

# Used in the client app
REACT_APP_CLIENT_HOST_DEV=localhost:3000
REACT_APP_API_HOST_DEV=localhost:3210
REACT_APP_CLIENT_HOST_DEV=http://localhost:3000
REACT_APP_API_HOST_DEV=http://localhost:3210

# Email connection parameters for sending team signup invites and forgot password emails
CB_MAIL_HOST_DEV=smtp.gmail.com
Expand Down
3 changes: 1 addition & 2 deletions server/modules/googleConnector.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ const { formatISO } = require("date-fns");

const settings = process.env.NODE_ENV === "production" ? require("../settings") : require("../settings-dev");

const protocol = settings.client.indexOf("localhost:") > -1 ? "http://" : "https://";
const getOAuthClient = () => {
return new google.auth.OAuth2(
settings.google.client_id,
settings.google.client_secret,
`${protocol}${settings.client}${settings.google.redirect_url}`,
`${settings.client}${settings.google.redirect_url}`,
);
};

Expand Down

0 comments on commit 07f5d4c

Please sign in to comment.