From 627b7791c32e7d5ec39c854d58cd58b5454829ad Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Mon, 15 Jan 2024 08:38:37 +0000 Subject: [PATCH] only send credentials to api host --- src/actions/action.js | 2 +- src/actions/index.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/actions/action.js b/src/actions/action.js index c6b89e58d3..6dfb868c7e 100644 --- a/src/actions/action.js +++ b/src/actions/action.js @@ -14,7 +14,7 @@ export default function action(type, host, path, params = {}, transform) { type: `ERROR/${type}`, error, }); - const fetchDataWithRetry = delay => fetch(url, { credentials: 'include' }) + const fetchDataWithRetry = delay => fetch(url, url.startsWith(config.VITE_API_HOST) ? { credentials: 'include' } : {}) .then((response) => { if (!response.ok || !response.status) { const err = new Error(); diff --git a/src/actions/index.js b/src/actions/index.js index 7ca2b0f78b..4828488271 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -36,7 +36,6 @@ export const getSearchResultAndPros = query => dispatch => Promise.all([ ...(/^\d+$/.test(query) ? [dispatch(getMatch(query))] : []), ]); export const getDistributions = () => action('distributions', config.VITE_API_HOST, 'api/distributions'); -export const getPvgnaHeroGuides = () => action('pvgnaGuides', 'https://yasp.pvgna.com', 'yasp'); export const getHeroStats = params => action('heroStats', config.VITE_API_HOST, 'api/heroStats', params); export const getLeagues = () => action('leagues', config.VITE_API_HOST, 'api/leagues'); export const getTeams = () => action('teams', config.VITE_API_HOST, 'api/teams');