@@ -79,7 +79,6 @@ export class AuthImpl implements AuthInternal, _FirebaseService {
7979 private idTokenSubscription = new Subscription < User > ( this ) ;
8080 private redirectUser : UserInternal | null = null ;
8181 private isProactiveRefreshEnabled = false ;
82- private redirectInitializerError : Error | null = null ;
8382
8483 // Any network calls will set this to true and prevent subsequent emulator
8584 // initialization
@@ -88,10 +87,8 @@ export class AuthImpl implements AuthInternal, _FirebaseService {
8887 _deleted = false ;
8988 _initializationPromise : Promise < void > | null = null ;
9089 _popupRedirectResolver : PopupRedirectResolverInternal | null = null ;
91- _errorFactory : ErrorFactory <
92- AuthErrorCode ,
93- AuthErrorParams
94- > = _DEFAULT_AUTH_ERROR_FACTORY ;
90+ _errorFactory : ErrorFactory < AuthErrorCode , AuthErrorParams > =
91+ _DEFAULT_AUTH_ERROR_FACTORY ;
9592 readonly name : string ;
9693
9794 // Tracks the last notified UID for state change listeners to prevent
@@ -150,12 +147,7 @@ export class AuthImpl implements AuthInternal, _FirebaseService {
150147 this . _isInitialized = true ;
151148 } ) ;
152149
153- // After initialization completes, throw any error caused by redirect flow
154- return this . _initializationPromise . then ( ( ) => {
155- if ( this . redirectInitializerError ) {
156- throw this . redirectInitializerError ;
157- }
158- } ) ;
150+ return this . _initializationPromise ;
159151 }
160152
161153 /**
@@ -191,7 +183,8 @@ export class AuthImpl implements AuthInternal, _FirebaseService {
191183 popupRedirectResolver ?: PopupRedirectResolver
192184 ) : Promise < void > {
193185 // First check to see if we have a pending redirect event.
194- let storedUser = ( await this . assertedPersistence . getCurrentUser ( ) ) as UserInternal | null ;
186+ let storedUser =
187+ ( await this . assertedPersistence . getCurrentUser ( ) ) as UserInternal | null ;
195188 if ( popupRedirectResolver && this . config . authDomain ) {
196189 await this . getOrInitRedirectPersistenceManager ( ) ;
197190 const redirectUserEventId = this . redirectUser ?. _redirectEventId ;
@@ -267,7 +260,8 @@ export class AuthImpl implements AuthInternal, _FirebaseService {
267260 true
268261 ) ;
269262 } catch ( e ) {
270- this . redirectInitializerError = e ;
263+ // Swallow any errors here; the code can retrieve them in
264+ // getRedirectResult().
271265 await this . _setRedirectUser ( null ) ;
272266 }
273267
@@ -419,7 +413,8 @@ export class AuthImpl implements AuthInternal, _FirebaseService {
419413 [ _getInstance ( resolver . _redirectPersistence ) ] ,
420414 KeyName . REDIRECT_USER
421415 ) ;
422- this . redirectUser = await this . redirectPersistenceManager . getCurrentUser ( ) ;
416+ this . redirectUser =
417+ await this . redirectPersistenceManager . getCurrentUser ( ) ;
423418 }
424419
425420 return this . redirectPersistenceManager ;
0 commit comments