File tree 3 files changed +23
-3
lines changed
3 files changed +23
-3
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @firebase/auth " : patch
3
+ " @firebase/component " : patch
4
+ ---
5
+
6
+ Auto initialize ` auth-internal ` after ` auth ` has been initialized.
Original file line number Diff line number Diff line change @@ -761,7 +761,16 @@ fireauth.exportlib.exportFunction(
761
761
'multipleInstances' : false ,
762
762
'serviceProps' : namespace ,
763
763
'instantiationMode' : 'LAZY' ,
764
- 'type' : 'PUBLIC'
764
+ 'type' : 'PUBLIC' ,
765
+ /**
766
+ * Initialize auth-internal after auth is initialized to make auth available to other firebase products.
767
+ */
768
+ 'onInstanceCreated' : function ( container , _instanceIdentifier , _instance ) {
769
+ const authInternalProvider = container [ 'getProvider' ] (
770
+ 'auth-internal'
771
+ ) ;
772
+ authInternalProvider [ 'initialize' ] ( ) ;
773
+ }
765
774
} ;
766
775
767
776
// Provides Auth internal APIs.
Original file line number Diff line number Diff line change @@ -251,8 +251,6 @@ export class Provider<T extends Name> {
251
251
}
252
252
}
253
253
254
- this . invokeOnInitCallbacks ( instance , normalizedIdentifier ) ;
255
-
256
254
return instance ;
257
255
}
258
256
@@ -318,6 +316,13 @@ export class Provider<T extends Name> {
318
316
} ) ;
319
317
this . instances . set ( instanceIdentifier , instance ) ;
320
318
319
+ /**
320
+ * Invoke onInit listeners.
321
+ * Note this.component.onInstanceCreated is different, which is used by the component creator,
322
+ * while onInit listeners are registered by consumers of the provider.
323
+ */
324
+ this . invokeOnInitCallbacks ( instance , instanceIdentifier ) ;
325
+
321
326
/**
322
327
* Order is important
323
328
* onInstanceCreated() should be called after this.instances.set(instanceIdentifier, instance); which
You can’t perform that action at this time.
0 commit comments