Skip to content

Commit

Permalink
fetchwrapper us API_BASE
Browse files Browse the repository at this point in the history
  • Loading branch information
devincowan committed Jan 10, 2024
1 parent 2efe1f5 commit 7f93b73
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/frontend/src/_helpers/fetchWrapper.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useAuthStore } from '@/stores/auth';
import { API_BASE } from '@/constants'

export const fetchWrapper = {
get: request('GET'),
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 7f93b73

Please sign in to comment.