Skip to content

Commit

Permalink
fix(client): remove custom VITE_MODE environment variable
Browse files Browse the repository at this point in the history
Favor Vite's built-in MODE variable
  • Loading branch information
ethanaturner committed Mar 3, 2023
1 parent 20429cc commit a311218
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions client/.env.dist
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
VITE_PRODUCTION_URLS=domain.com
VITE_DISABLE_CONDUCTOR=false
VITE_DEV_BASE_URL=http://localhost:5000
VITE_MODE=development
VITE_DEV_BASE_URL=http://localhost:5000
2 changes: 1 addition & 1 deletion client/src/Platform.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import './styles/global.css';
*/
const Platform = () => {
/* Configure global Axios defaults */
axios.defaults.baseURL = (import.meta.env.VITE_MODE === 'development') ? `${import.meta.env.VITE_DEV_BASE_URL}/api/v1` : '/api/v1';
axios.defaults.baseURL = (import.meta.env.MODE === 'development') ? `${import.meta.env.VITE_DEV_BASE_URL}/api/v1` : '/api/v1';
axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
axios.defaults.headers.post['Content-Type'] = 'application/json';
axios.defaults.withCredentials = true;
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/auth/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ const Login = () => {
};

const initSSOLogin = () => {
if (import.meta.env.VITE_MODE === 'production') {
if (import.meta.env.MODE === 'production') {
const domains = import.meta.env.VITE_PRODUCTION_URLS ? import.meta.env.VITE_PRODUCTION_URLS.split(',') : ['libretexts.org'];
Cookies.set('conductor_sso_redirect', window.location.protocol + "//" + window.location.hostname, { domain: domains[0], sameSite: 'lax'});
} else {
Expand Down

0 comments on commit a311218

Please sign in to comment.