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
496
496
private forceRefresh = false ;
497
497
private appCheck : FirebaseAppCheckInternal | null = null ;
498
498
private latestAppCheckToken : string | null = null ;
499
+ private serverAppAppCheckToken : string | null = null ;
499
500
500
501
constructor (
501
- private app : FirebaseApp ,
502
+ app : FirebaseApp ,
502
503
private appCheckProvider : Provider < AppCheckInternalComponentName >
503
- ) { }
504
+ ) {
505
+ if ( _isFirebaseServerApp ( app ) && app . settings . appCheckToken ) {
506
+ this . serverAppAppCheckToken = app . settings . appCheckToken ;
507
+ }
508
+ }
504
509
505
510
start (
506
511
asyncQueue : AsyncQueue ,
@@ -564,10 +569,8 @@ export class FirebaseAppCheckTokenProvider
564
569
}
565
570
566
571
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 ) ) ;
571
574
}
572
575
debugAssert (
573
576
this . tokenListener != null ,
You can’t perform that action at this time.
0 commit comments