File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
packages/firestore/src/api Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -496,11 +496,16 @@ export class FirebaseAppCheckTokenProvider
496496 private forceRefresh = false ;
497497 private appCheck : FirebaseAppCheckInternal | null = null ;
498498 private latestAppCheckToken : string | null = null ;
499+ private serverAppAppCheckToken : string | null = null ;
499500
500501 constructor (
501- private app : FirebaseApp ,
502+ app : FirebaseApp ,
502503 private appCheckProvider : Provider < AppCheckInternalComponentName >
503- ) { }
504+ ) {
505+ if ( _isFirebaseServerApp ( app ) && app . settings . appCheckToken ) {
506+ this . serverAppAppCheckToken = app . settings . appCheckToken ;
507+ }
508+ }
504509
505510 start (
506511 asyncQueue : AsyncQueue ,
@@ -564,10 +569,8 @@ export class FirebaseAppCheckTokenProvider
564569 }
565570
566571 getToken ( ) : Promise < Token | null > {
567- if ( _isFirebaseServerApp ( this . app ) && this . app . settings . appCheckToken ) {
568- return Promise . resolve (
569- new AppCheckToken ( this . app . settings . appCheckToken )
570- ) ;
572+ if ( this . serverAppAppCheckToken !== null ) {
573+ return Promise . resolve ( new AppCheckToken ( this . serverAppAppCheckToken ) ) ;
571574 }
572575 debugAssert (
573576 this . tokenListener != null ,
You can’t perform that action at this time.
0 commit comments