File tree 6 files changed +16
-2
lines changed 6 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -101,8 +101,8 @@ export function connectAuthEmulator(
101
101
emitEmulatorWarning ( ) ;
102
102
}
103
103
104
+ // Workaround to get cookies in Firebase Studio
104
105
if ( isCloudWorkstation ( host ) ) {
105
- // Workaround to get cookies in Firebase Studio
106
106
void pingServer ( `${ protocol } //${ host } :${ port } ` ) ;
107
107
}
108
108
}
Original file line number Diff line number Diff line change @@ -238,6 +238,7 @@ export function connectDataConnectEmulator(
238
238
port ?: number ,
239
239
sslEnabled = false
240
240
) : void {
241
+ // Workaround to get cookies in Firebase Studio
241
242
if ( isCloudWorkstation ( host ) ) {
242
243
void pingServer ( `https://${ host } ${ port ? `:${ port } ` : '' } ` ) ;
243
244
}
Original file line number Diff line number Diff line change @@ -390,6 +390,7 @@ export function connectDatabaseEmulator(
390
390
tokenProvider = new EmulatorTokenProvider ( token ) ;
391
391
}
392
392
393
+ // Workaround to get cookies in Firebase Studio
393
394
if ( isCloudWorkstation ( host ) ) {
394
395
void pingServer ( host ) ;
395
396
}
Original file line number Diff line number Diff line change @@ -21,7 +21,12 @@ import {
21
21
FirebaseApp ,
22
22
getApp
23
23
} from '@firebase/app' ;
24
- import { deepEqual , getDefaultEmulatorHostnameAndPort } from '@firebase/util' ;
24
+ import {
25
+ deepEqual ,
26
+ getDefaultEmulatorHostnameAndPort ,
27
+ isCloudWorkstation ,
28
+ pingServer
29
+ } from '@firebase/util' ;
25
30
26
31
import { User } from '../auth/user' ;
27
32
import {
@@ -194,6 +199,11 @@ export function initializeFirestore(
194
199
) ;
195
200
}
196
201
202
+ // Workaround to get cookies in Firebase Studio
203
+ if ( settings . host && isCloudWorkstation ( settings . host ) ) {
204
+ void pingServer ( settings . host ) ;
205
+ }
206
+
197
207
return provider . initialize ( {
198
208
options : settings ,
199
209
instanceIdentifier : databaseId
Original file line number Diff line number Diff line change @@ -179,6 +179,7 @@ export function connectFunctionsEmulator(
179
179
functionsInstance . emulatorOrigin = `http${
180
180
useSsl ? 's' : ''
181
181
} ://${ host } :${ port } `;
182
+ // Workaround to get cookies in Firebase Studio
182
183
if ( useSsl ) {
183
184
void pingServer ( functionsInstance . emulatorOrigin ) ;
184
185
}
Original file line number Diff line number Diff line change @@ -147,6 +147,7 @@ export function connectStorageEmulator(
147
147
) : void {
148
148
storage . host = `${ host } :${ port } ` ;
149
149
const useSsl = isCloudWorkstation ( host ) ;
150
+ // Workaround to get cookies in Firebase Studio
150
151
if ( useSsl ) {
151
152
void pingServer ( `https://${ storage . host } ` ) ;
152
153
}
You can’t perform that action at this time.
0 commit comments