Skip to content

Commit

Permalink
only send credentials to api host
Browse files Browse the repository at this point in the history
  • Loading branch information
howardchung committed Jan 15, 2024
1 parent 14625f4 commit 627b779
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion src/actions/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 0 additions & 1 deletion src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 627b779

Please sign in to comment.