Skip to content

Commit 78a4fea

Browse files
committed
Updated comments
1 parent 9de2506 commit 78a4fea

File tree

6 files changed

+16
-2
lines changed

6 files changed

+16
-2
lines changed

packages/auth/src/core/auth/emulator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ export function connectAuthEmulator(
101101
emitEmulatorWarning();
102102
}
103103

104+
// Workaround to get cookies in Firebase Studio
104105
if (isCloudWorkstation(host)) {
105-
// Workaround to get cookies in Firebase Studio
106106
void pingServer(`${protocol}//${host}:${port}`);
107107
}
108108
}

packages/data-connect/src/api/DataConnect.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ export function connectDataConnectEmulator(
238238
port?: number,
239239
sslEnabled = false
240240
): void {
241+
// Workaround to get cookies in Firebase Studio
241242
if (isCloudWorkstation(host)) {
242243
void pingServer(`https://${host}${port ? `:${port}` : ''}`);
243244
}

packages/database/src/api/Database.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ export function connectDatabaseEmulator(
390390
tokenProvider = new EmulatorTokenProvider(token);
391391
}
392392

393+
// Workaround to get cookies in Firebase Studio
393394
if (isCloudWorkstation(host)) {
394395
void pingServer(host);
395396
}

packages/firestore/src/api/database.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ import {
2121
FirebaseApp,
2222
getApp
2323
} from '@firebase/app';
24-
import { deepEqual, getDefaultEmulatorHostnameAndPort } from '@firebase/util';
24+
import {
25+
deepEqual,
26+
getDefaultEmulatorHostnameAndPort,
27+
isCloudWorkstation,
28+
pingServer
29+
} from '@firebase/util';
2530

2631
import { User } from '../auth/user';
2732
import {
@@ -194,6 +199,11 @@ export function initializeFirestore(
194199
);
195200
}
196201

202+
// Workaround to get cookies in Firebase Studio
203+
if (settings.host && isCloudWorkstation(settings.host)) {
204+
void pingServer(settings.host);
205+
}
206+
197207
return provider.initialize({
198208
options: settings,
199209
instanceIdentifier: databaseId

packages/functions/src/service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ export function connectFunctionsEmulator(
179179
functionsInstance.emulatorOrigin = `http${
180180
useSsl ? 's' : ''
181181
}://${host}:${port}`;
182+
// Workaround to get cookies in Firebase Studio
182183
if (useSsl) {
183184
void pingServer(functionsInstance.emulatorOrigin);
184185
}

packages/storage/src/service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ export function connectStorageEmulator(
147147
): void {
148148
storage.host = `${host}:${port}`;
149149
const useSsl = isCloudWorkstation(host);
150+
// Workaround to get cookies in Firebase Studio
150151
if (useSsl) {
151152
void pingServer(`https://${storage.host}`);
152153
}

0 commit comments

Comments
 (0)