diff --git a/client/gatsby-config.js b/client/gatsby-config.js index 70a4849c8b..7e5076c75e 100644 --- a/client/gatsby-config.js +++ b/client/gatsby-config.js @@ -6,8 +6,6 @@ const { localeChallengesRootDir } = require('./utils/buildChallenges'); -const { API_PROXY: proxyUrl = 'http://localhost:3000' } = process.env; - const curriculumIntroRoot = path.resolve(__dirname, './src/pages'); module.exports = { @@ -15,10 +13,6 @@ module.exports = { title: 'freeCodeCamp', siteUrl: 'https://www.freecodecamp.org' }, - proxy: { - prefix: '/internal', - url: proxyUrl - }, plugins: [ 'gatsby-plugin-react-helmet', 'gatsby-plugin-postcss', diff --git a/client/src/components/Donation/components/DonateForm.js b/client/src/components/Donation/components/DonateForm.js index 7cca4eab04..c5ceddae4d 100644 --- a/client/src/components/Donation/components/DonateForm.js +++ b/client/src/components/Donation/components/DonateForm.js @@ -124,7 +124,7 @@ class DonateForm extends Component { })); const chargeStripePath = isSignedIn - ? '/internal/donate/charge-stripe' + ? `${apiLocation}/internal/donate/charge-stripe` : `${apiLocation}/unauthenticated/donate/charge-stripe`; return postJSON$(chargeStripePath, { token, diff --git a/client/src/utils/ajax.js b/client/src/utils/ajax.js index 7c9677a581..793a9ffad4 100644 --- a/client/src/utils/ajax.js +++ b/client/src/utils/ajax.js @@ -1,6 +1,9 @@ +import { apiLocation } from '../../config/env.json'; + import axios from 'axios'; -const base = '/internal'; +const base = apiLocation + '/internal'; + axios.defaults.withCredentials = true; function get(path) {