From c5853a77861afce6a5ea337fde490ec48f4ade71 Mon Sep 17 00:00:00 2001 From: Andres Pinto <143480783+apsantiso@users.noreply.github.com> Date: Tue, 3 Nov 2026 11:18:56 +0100 Subject: [PATCH 1/4] feat: send cookies to requests --- package.json | 2 +- src/app/core/factory/sdk/index.test.ts | 4 ++++ src/app/core/factory/sdk/index.ts | 2 +- src/app/drive/services/new-storage.service.ts | 12 +++++++++--- yarn.lock | 12 ++++++------ 5 files changed, 21 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index d297ebaae7..87059ed803 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "@iconscout/react-unicons": "^2.2.5", "@internxt/css-config": "1.1.1", "@internxt/lib": "=1.5.1", - "@internxt/sdk": "=1.23.0", + "@internxt/sdk": "=1.25.0", "@internxt/ui": "=0.1.21", "@marsidev/react-turnstile": "^1.6.1", "@phosphor-icons/react": "^2.1.10", diff --git a/src/app/core/factory/sdk/index.test.ts b/src/app/core/factory/sdk/index.test.ts index c3b5fc03f0..2738c16df5 100644 --- a/src/app/core/factory/sdk/index.test.ts +++ b/src/app/core/factory/sdk/index.test.ts @@ -330,6 +330,7 @@ describe('SdkFactory', () => { clientVersion: packageJson.version, }, expect.any(Object), + { withCredentials: true }, ); }); @@ -352,6 +353,7 @@ describe('SdkFactory', () => { }, }, expect.any(Object), + { withCredentials: true }, ); }); @@ -373,6 +375,7 @@ describe('SdkFactory', () => { }, }, expect.any(Object), + { withCredentials: true }, ); }); @@ -396,6 +399,7 @@ describe('SdkFactory', () => { }, }, expect.any(Object), + { withCredentials: true }, ); }); diff --git a/src/app/core/factory/sdk/index.ts b/src/app/core/factory/sdk/index.ts index 3fa43225ea..bedb76da04 100644 --- a/src/app/core/factory/sdk/index.ts +++ b/src/app/core/factory/sdk/index.ts @@ -65,7 +65,7 @@ export class SdkFactory { turnstileToken: options?.turnstileToken, }); const apiSecurity = this.getNewApiSecurity(options?.unauthorizedCallback); - return Auth.client(apiUrl, appDetails, apiSecurity); + return Auth.client(apiUrl, appDetails, apiSecurity, { withCredentials: true }); } public createDesktopAuthClient(options?: { turnstileToken?: string }): Auth { diff --git a/src/app/drive/services/new-storage.service.ts b/src/app/drive/services/new-storage.service.ts index d3a9c71f57..b6c8dea10a 100644 --- a/src/app/drive/services/new-storage.service.ts +++ b/src/app/drive/services/new-storage.service.ts @@ -1,10 +1,10 @@ import { CheckDuplicatedFilesResponse, CheckDuplicatedFoldersResponse, + FetchFolderMetaResponse, FileStructure, FetchFolderContentResponse, FolderAncestor, - FolderMeta, FolderAncestorWorkspace, FolderStatsResponse, } from '@internxt/sdk/dist/drive/storage/types'; @@ -33,7 +33,11 @@ export async function getFolderAncestorsInWorkspace( return storageClient.getFolderAncestorsInWorkspace(workspaceId, itemType, uuid, resourcesToken); } -export async function getFolderMeta(uuid: string, workspaceId?: string, resourcesToken?: string): Promise { +export async function getFolderMeta( + uuid: string, + workspaceId?: string, + resourcesToken?: string, +): Promise { const storageClient = SdkFactory.getNewApiInstance().createNewStorageClient(); return storageClient.getFolderMeta(uuid, workspaceId, resourcesToken); } @@ -56,7 +60,9 @@ export async function checkDuplicatedFolders( folderNamesList: string[], ): Promise { const storageClient = SdkFactory.getNewApiInstance().createNewStorageClient(); - return storageClient.checkDuplicatedFolders({ folderUuid, folderNamesList }); + // SDK >=1.24 types this from the API schema (camelCase); callers still consume it as DriveFolderData + const response = await storageClient.checkDuplicatedFolders({ folderUuid, folderNamesList }); + return response as unknown as CheckDuplicatedFoldersResponse; } export function getFolderContentByUuid({ diff --git a/yarn.lock b/yarn.lock index e9c7996f84..f07d6d39fb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1939,12 +1939,12 @@ resolved "https://registry.yarnpkg.com/@internxt/prettier-config/-/prettier-config-2.0.1.tgz#a25e7a16f62a990aed2bd1804e04140cc8c33e77" integrity sha512-sCnOMX7GR7BYDJ5OH1RiV/JaOBLE3uhL6QN6tYhMKi7QXK/cnM/77qmDlIEBlhTNIFEMLFljSkc0vZEvf6m2xA== -"@internxt/sdk@=1.23.0": - version "1.23.0" - resolved "https://registry.yarnpkg.com/@internxt/sdk/-/sdk-1.23.0.tgz#ea6ce0f33f551f380f7ab246e220f6f4141d5b44" - integrity sha512-ljgn8oHmu7+pSkDlWktIf26jboqg/c5daA7LTyxbKIyw+b5I3qi2ZtNOVO0F6pJlrVWJHrTI+FG4qjdQGgNmAA== +"@internxt/sdk@=1.25.0": + version "1.25.0" + resolved "https://registry.yarnpkg.com/@internxt/sdk/-/sdk-1.25.0.tgz#3a66d7b8a8b5daa3bc1980c5820e9863933f083a" + integrity sha512-kpbqz7YmqheBBHJgReJ9dr189Qim312JyfhGw1M3D0m6xPLXFgPi8FEViND70+YnAdWC3CRVXrD0hH3JjM+ZrQ== dependencies: - axios "^1.16.0" + axios "^1.20.0" "@internxt/ui@=0.1.21": version "0.1.21" @@ -4216,7 +4216,7 @@ available-typed-arrays@^1.0.7: dependencies: possible-typed-array-names "^1.0.0" -axios@^1.16.0, axios@^1.20.0: +axios@^1.20.0: version "1.20.0" resolved "https://registry.yarnpkg.com/axios/-/axios-1.20.0.tgz#515513445aa60e71d04b6521ca6210829ccb4786" integrity sha512-r8aOh8j9cGKpgQAqpzrUHnSIc6a59Y3Xf/cv8sy1DrHCkZHzQGEuoq1tARk6qSyDdtQGSDgpb9kFlruzPvrgwg== From b4af1dd9a94528394101640f022a4e65cbc72474 Mon Sep 17 00:00:00 2001 From: Andres Pinto <143480783+apsantiso@users.noreply.github.com> Date: Tue, 3 Nov 2026 11:43:16 +0100 Subject: [PATCH 2/4] fix: fix e2e --- .../specs/DRIVE-internxt-upload-stall-recovery.spec.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/e2e/tests/specs/DRIVE-internxt-upload-stall-recovery.spec.ts b/test/e2e/tests/specs/DRIVE-internxt-upload-stall-recovery.spec.ts index 85944fce6d..5df77984b5 100644 --- a/test/e2e/tests/specs/DRIVE-internxt-upload-stall-recovery.spec.ts +++ b/test/e2e/tests/specs/DRIVE-internxt-upload-stall-recovery.spec.ts @@ -24,7 +24,12 @@ const isStorageHost = (url: URL) => !url.hostname.includes('internxt') && url.ho const allowApiCallsFromLocalhost = (page: Page) => page.route(isInternxtApi, async (route, request) => { - const corsHeaders = { 'access-control-allow-origin': LOCAL_ORIGIN, 'access-control-allow-headers': '*' }; + const corsHeaders = { + 'access-control-allow-origin': LOCAL_ORIGIN, + 'access-control-allow-credentials': 'true', + 'access-control-allow-headers': request.headers()['access-control-request-headers'] ?? '', + 'access-control-allow-methods': request.headers()['access-control-request-method'] ?? '', + }; const isPreflight = request.method() === 'OPTIONS'; if (isPreflight) return route.fulfill({ status: 204, headers: corsHeaders }); From d33345d68a4d7f79bb52b8f540cfb0463e27b3ba Mon Sep 17 00:00:00 2001 From: Andres Pinto <143480783+apsantiso@users.noreply.github.com> Date: Tue, 3 Nov 2026 11:46:56 +0100 Subject: [PATCH 3/4] chore: added comment to cast --- src/app/drive/services/new-storage.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/drive/services/new-storage.service.ts b/src/app/drive/services/new-storage.service.ts index b6c8dea10a..864ff9bb69 100644 --- a/src/app/drive/services/new-storage.service.ts +++ b/src/app/drive/services/new-storage.service.ts @@ -60,7 +60,7 @@ export async function checkDuplicatedFolders( folderNamesList: string[], ): Promise { const storageClient = SdkFactory.getNewApiInstance().createNewStorageClient(); - // SDK >=1.24 types this from the API schema (camelCase); callers still consume it as DriveFolderData + // TODO: remove cast once callers use the SDK's FetchExistentFoldersResponse type const response = await storageClient.checkDuplicatedFolders({ folderUuid, folderNamesList }); return response as unknown as CheckDuplicatedFoldersResponse; } From bcdec8526216682af87eaf3530bbd8afc82afcc8 Mon Sep 17 00:00:00 2001 From: Andres Pinto <143480783+apsantiso@users.noreply.github.com> Date: Tue, 3 Nov 2026 12:09:57 +0100 Subject: [PATCH 4/4] fix: added credentials to desktop client too --- src/app/core/factory/sdk/index.test.ts | 2 ++ src/app/core/factory/sdk/index.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/core/factory/sdk/index.test.ts b/src/app/core/factory/sdk/index.test.ts index 2738c16df5..c25e7c3042 100644 --- a/src/app/core/factory/sdk/index.test.ts +++ b/src/app/core/factory/sdk/index.test.ts @@ -421,6 +421,7 @@ describe('SdkFactory', () => { }, }, expect.any(Object), + { withCredentials: true }, ); }); @@ -438,6 +439,7 @@ describe('SdkFactory', () => { customHeaders: undefined, }, expect.any(Object), + { withCredentials: true }, ); }); }); diff --git a/src/app/core/factory/sdk/index.ts b/src/app/core/factory/sdk/index.ts index bedb76da04..433739e8d6 100644 --- a/src/app/core/factory/sdk/index.ts +++ b/src/app/core/factory/sdk/index.ts @@ -74,7 +74,7 @@ export class SdkFactory { options?.turnstileToken ? { 'x-internxt-turnstile': options.turnstileToken } : undefined, ); const apiSecurity = this.getNewApiSecurity(); - return Auth.client(apiUrl, appDetails, apiSecurity); + return Auth.client(apiUrl, appDetails, apiSecurity, { withCredentials: true }); } public createNewStorageClient(): Storage {