Skip to content

Commit 88d96e2

Browse files
committed
Fixed issue where requestSts wasn't including the Studio cookie in its response
1 parent 30de503 commit 88d96e2

File tree

1 file changed

+10
-3
lines changed
  • packages/auth/src/api/authentication

1 file changed

+10
-3
lines changed

packages/auth/src/api/authentication/token.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
/* eslint-disable camelcase */
1919

20-
import { querystring } from '@firebase/util';
20+
import { isCloudWorkstation, querystring } from '@firebase/util';
2121

2222
import {
2323
_getFinalTarget,
@@ -84,11 +84,18 @@ export async function requestStsToken(
8484
const headers = await (auth as AuthInternal)._getAdditionalHeaders();
8585
headers[HttpHeader.CONTENT_TYPE] = 'application/x-www-form-urlencoded';
8686

87-
return FetchProvider.fetch()(url, {
87+
const options: RequestInit = {
8888
method: HttpMethod.POST,
8989
headers,
9090
body
91-
});
91+
};
92+
if (
93+
auth.emulatorConfig &&
94+
isCloudWorkstation(auth.emulatorConfig.host)
95+
) {
96+
options.credentials = 'include';
97+
}
98+
return FetchProvider.fetch()(url, options);
9299
}
93100
);
94101

0 commit comments

Comments
 (0)