Pass HTTP credentials through to the API server when appropriate CORS headers are set

This commit is contained in:
Stephen Touset
2025-04-16 09:56:27 -07:00
committed by Alejandro Celaya
parent c1bbeeb6ac
commit d1d6a6b373
3 changed files with 3 additions and 2 deletions

View File

@@ -23,7 +23,7 @@ export const buildShlinkApiClient = (httpClient: HttpClient) => (getStateOrSelec
: getStateOrSelectedServer;
const serverKey = `${apiKey}_${baseUrl}`;
const apiClient = apiClients[serverKey] ?? new ShlinkApiClient(httpClient, { apiKey, baseUrl });
const apiClient = apiClients[serverKey] ?? new ShlinkApiClient(httpClient, { apiKey, baseUrl }, { credentials: 'include' });
apiClients[serverKey] = apiClient;
return apiClient;