File tree Expand file tree Collapse file tree 6 files changed +16
-2
lines changed
Expand file tree Collapse file tree 6 files changed +16
-2
lines changed Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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
2631import { User } from '../auth/user' ;
2732import {
@@ -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
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments