fix: Support auth by sending cookies in scaffolder eventstream request

Signed-off-by: Erik Larsson <erik.larsson@schibsted.com>
This commit is contained in:
Erik Larsson
2021-04-02 03:28:06 +02:00
parent 2bbac57ce4
commit 3f96a9d5a7
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder': patch
---
Support auth by sending cookies in eventstream request
+1 -1
View File
@@ -196,7 +196,7 @@ export class ScaffolderClient implements ScaffolderApi {
const url = `${baseUrl}/v2/tasks/${encodeURIComponent(
taskId,
)}/eventstream`;
const eventSource = new EventSource(url);
const eventSource = new EventSource(url, { withCredentials: true });
eventSource.addEventListener('log', (event: any) => {
if (event.data) {
try {