mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
[skip ci] send cookie to other origins only if account is enabled
This commit is contained in:
@@ -4,6 +4,7 @@ import React from 'react';
|
||||
|
||||
import type { CsrfData } from 'types/client/account';
|
||||
|
||||
import appConfig from 'configs/app/config';
|
||||
import isBodyAllowed from 'lib/api/isBodyAllowed';
|
||||
import isNeedProxy from 'lib/api/isNeedProxy';
|
||||
import { getResourceKey } from 'lib/api/useApiQuery';
|
||||
@@ -44,7 +45,11 @@ export default function useApiFetch() {
|
||||
return fetch<SuccessType, ErrorType>(
|
||||
url,
|
||||
{
|
||||
credentials: 'include',
|
||||
// as of today, we use cookies only
|
||||
// for user authentication in My account
|
||||
// for API rate-limits (cannot use in the condition though, but we agreed with devops team that should not be an issue)
|
||||
// change condition here if something is changed
|
||||
credentials: appConfig.account.isEnabled ? 'include' : 'same-origin',
|
||||
headers,
|
||||
...fetchParams,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user