Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/wicked-scissors-yell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@firebase/auth": patch
---

Fixed issue where requestSts wasn't including the Firebase Studio cookie in it
13 changes: 10 additions & 3 deletions packages/auth/src/api/authentication/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

/* eslint-disable camelcase */

import { querystring } from '@firebase/util';
import { isCloudWorkstation, querystring } from '@firebase/util';

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

return FetchProvider.fetch()(url, {
const options: RequestInit = {
method: HttpMethod.POST,
headers,
body
});
};
if (
auth.emulatorConfig &&
isCloudWorkstation(auth.emulatorConfig.host)
) {
options.credentials = 'include';
}
return FetchProvider.fetch()(url, options);
}
);

Expand Down
Loading