Skip to content

Commit 014ae11

Browse files
committed
Call setWithCredentials(true) on XhrIo
1 parent de32c24 commit 014ae11

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

packages/firestore/src/platform/browser/webchannel_connection.ts

+1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export class WebChannelConnection extends RestConnection {
7272
): Promise<Resp> {
7373
return new Promise((resolve: Resolver<Resp>, reject: Rejecter) => {
7474
const xhr = new XhrIo();
75+
xhr.setWithCredentials(true);
7576
xhr.listenOnce(EventType.COMPLETE, () => {
7677
try {
7778
switch (xhr.getLastErrorCode()) {

packages/webchannel-wrapper/src/index.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ export class XhrIo {
7474
getResponseJson(): WebChannelError | object;
7575

7676
listenOnce(type: string, cb: (param: unknown) => void): void;
77+
78+
setWithCredentials(withCredentials: boolean): void;
7779
}
7880

7981
export interface WebChannelOptions {

packages/webchannel-wrapper/src/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ goog.net.XhrIo.prototype['getResponseJson'] =
7575
goog.net.XhrIo.prototype['getResponseText'] =
7676
goog.net.XhrIo.prototype.getResponseText;
7777
goog.net.XhrIo.prototype['send'] = goog.net.XhrIo.prototype.send;
78+
goog.net.XhrIo.prototype['setWithCredentials'] = goog.net.XhrIo.prototype.setWithCredentials;
7879

7980
module['exports']['createWebChannelTransport'] =
8081
goog.net.createWebChannelTransport;

0 commit comments

Comments
 (0)