From 7f93b732946f453a49cb7b272088c37591860677 Mon Sep 17 00:00:00 2001 From: Devin Cowan Date: Wed, 10 Jan 2024 13:19:28 -0500 Subject: [PATCH] fetchwrapper us API_BASE --- app/frontend/src/_helpers/fetchWrapper.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/frontend/src/_helpers/fetchWrapper.js b/app/frontend/src/_helpers/fetchWrapper.js index 6f725532..5aefd326 100644 --- a/app/frontend/src/_helpers/fetchWrapper.js +++ b/app/frontend/src/_helpers/fetchWrapper.js @@ -1,4 +1,5 @@ import { useAuthStore } from '@/stores/auth'; +import { API_BASE } from '@/constants' export const fetchWrapper = { get: request('GET'), @@ -29,7 +30,7 @@ function authHeader(url) { const authStore = useAuthStore(); const jwt = authStore.getToken() const isLoggedIn = !!jwt; - const isApiUrl = url.startsWith(import.meta.env.VITE_APP_API_URL); + const isApiUrl = url.startsWith(API_BASE); if (isLoggedIn && isApiUrl) { return { Authorization: `Bearer ${jwt}` }; } else {