diff --git a/Composer/packages/client/src/recoilModel/dispatchers/utils/project.ts b/Composer/packages/client/src/recoilModel/dispatchers/utils/project.ts index 356238e05a..0d0a56a66e 100644 --- a/Composer/packages/client/src/recoilModel/dispatchers/utils/project.ts +++ b/Composer/packages/client/src/recoilModel/dispatchers/utils/project.ts @@ -912,7 +912,12 @@ export const checkIfBotExistsInBotProjectFile = async ( }; export const getMemoryVariables = async (projectId: string, options?: { signal: AbortSignal }) => { - const res = await fetch(`${BASEURL}/projects/${projectId}/variables`, { signal: options?.signal }); + // eslint-disable-next-line no-underscore-dangle + const fetchHeaders = { 'X-CSRF-Token': window.__csrf__ }; + const res = await fetch(`${BASEURL}/projects/${projectId}/variables`, { + headers: fetchHeaders, + signal: options?.signal, + }); const json = (await res.json()) as { variables: string[] }; return json.variables ?? []; }; diff --git a/Composer/packages/lib/shared/src/axios.ts b/Composer/packages/lib/shared/src/axios.ts index e1266ffdae..e9748ccf0e 100644 --- a/Composer/packages/lib/shared/src/axios.ts +++ b/Composer/packages/lib/shared/src/axios.ts @@ -6,7 +6,7 @@ import Axios, { AxiosInstance, AxiosRequestConfig } from 'axios'; export * from 'axios'; const csrfInterceptor = (config: AxiosRequestConfig) => { - if (config.baseURL?.startsWith('/api') || config.url?.startsWith('/api')) { + if (config?.baseURL?.startsWith('/api') || config?.url?.startsWith('/api')) { // eslint-disable-next-line no-underscore-dangle config.headers['X-CSRF-Token'] = ((window as unknown) as { __csrf__: string }).__csrf__; } diff --git a/extensions/azurePublish/yarn-berry.lock b/extensions/azurePublish/yarn-berry.lock index a1202decd3..5a03aee823 100644 --- a/extensions/azurePublish/yarn-berry.lock +++ b/extensions/azurePublish/yarn-berry.lock @@ -1911,7 +1911,7 @@ __metadata: "@bfc/shared@file:../../Composer/packages/lib/shared::locator=azurePublish%40workspace%3A.": version: 0.0.0 - resolution: "@bfc/shared@file:../../Composer/packages/lib/shared#../../Composer/packages/lib/shared::hash=823a6f&locator=azurePublish%40workspace%3A." + resolution: "@bfc/shared@file:../../Composer/packages/lib/shared#../../Composer/packages/lib/shared::hash=4ac2ba&locator=azurePublish%40workspace%3A." dependencies: "@botframework-composer/types": "*" format-message: 6.2.4 @@ -1925,7 +1925,7 @@ __metadata: react: 16.13.1 react-dom: 16.13.1 tslib: 2.4.0 - checksum: 0151f655c015639587f6687101f0bc056a07611770ee08d2dc60dc8b61f81e7d6d21e86b4439135ec4270368eff57518c9a4e1bce48eba4099e9a998f35b9500 + checksum: 167ca35df96fc7031c96dae9c3bba35fdcbb49ef03761b69c7cd61cbab963b9dd3e1e1080d96f636459af4efa676bfe8e1df1f6427f9044169a753e9b44c6f5b languageName: node linkType: hard diff --git a/extensions/azurePublishNew/yarn-berry.lock b/extensions/azurePublishNew/yarn-berry.lock index 9600333b30..32176f1da2 100644 --- a/extensions/azurePublishNew/yarn-berry.lock +++ b/extensions/azurePublishNew/yarn-berry.lock @@ -1951,7 +1951,7 @@ __metadata: "@bfc/shared@file:../../Composer/packages/lib/shared::locator=azure-publish-new%40workspace%3A.": version: 0.0.0 - resolution: "@bfc/shared@file:../../Composer/packages/lib/shared#../../Composer/packages/lib/shared::hash=823a6f&locator=azure-publish-new%40workspace%3A." + resolution: "@bfc/shared@file:../../Composer/packages/lib/shared#../../Composer/packages/lib/shared::hash=4ac2ba&locator=azure-publish-new%40workspace%3A." dependencies: "@botframework-composer/types": "*" format-message: 6.2.4 @@ -1965,7 +1965,7 @@ __metadata: react: 16.13.1 react-dom: 16.13.1 tslib: 2.4.0 - checksum: 0151f655c015639587f6687101f0bc056a07611770ee08d2dc60dc8b61f81e7d6d21e86b4439135ec4270368eff57518c9a4e1bce48eba4099e9a998f35b9500 + checksum: 167ca35df96fc7031c96dae9c3bba35fdcbb49ef03761b69c7cd61cbab963b9dd3e1e1080d96f636459af4efa676bfe8e1df1f6427f9044169a753e9b44c6f5b languageName: node linkType: hard