File tree Expand file tree Collapse file tree 3 files changed +23
-3
lines changed Expand file tree Collapse file tree 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(
761761 'multipleInstances' : false ,
762762 'serviceProps' : namespace ,
763763 '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+ }
765774 } ;
766775
767776 // Provides Auth internal APIs.
Original file line number Diff line number Diff line change @@ -251,8 +251,6 @@ export class Provider<T extends Name> {
251251 }
252252 }
253253
254- this . invokeOnInitCallbacks ( instance , normalizedIdentifier ) ;
255-
256254 return instance ;
257255 }
258256
@@ -318,6 +316,13 @@ export class Provider<T extends Name> {
318316 } ) ;
319317 this . instances . set ( instanceIdentifier , instance ) ;
320318
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+
321326 /**
322327 * Order is important
323328 * onInstanceCreated() should be called after this.instances.set(instanceIdentifier, instance); which
You can’t perform that action at this time.
0 commit comments