File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
packages/auth/src/core/auth Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -814,9 +814,9 @@ export class AuthImpl implements AuthInternal, _FirebaseService {
814814 }
815815 }
816816
817- private registerStateListener (
818- subscription : Subscription < User > ,
819- nextOrObserver : NextOrObserver < User > ,
817+ private registerStateListener < T > (
818+ subscription : Subscription < T > ,
819+ nextOrObserver : NextOrObserver < T > ,
820820 error ?: ErrorFn ,
821821 completed ?: CompleteFn
822822 ) : Unsubscribe {
@@ -841,7 +841,14 @@ export class AuthImpl implements AuthInternal, _FirebaseService {
841841 if ( isUnsubscribed ) {
842842 return ;
843843 }
844- cb ( this . currentUser ) ;
844+ if (
845+ ( subscription as unknown ) === this . idTokenSubscription ||
846+ ( subscription as unknown ) === this . authStateSubscription
847+ ) {
848+ cb ( this . currentUser as unknown as T ) ;
849+ } else if ( ( subscription as unknown ) === this . firebaseTokenSubscription ) {
850+ cb ( this . firebaseToken as unknown as T ) ;
851+ }
845852 } ) ;
846853
847854 if ( typeof nextOrObserver === 'function' ) {
You can’t perform that action at this time.
0 commit comments