@@ -79,7 +79,6 @@ export class AuthImpl implements AuthInternal, _FirebaseService {
79
79
private idTokenSubscription = new Subscription < User > ( this ) ;
80
80
private redirectUser : UserInternal | null = null ;
81
81
private isProactiveRefreshEnabled = false ;
82
- private redirectInitializerError : Error | null = null ;
83
82
84
83
// Any network calls will set this to true and prevent subsequent emulator
85
84
// initialization
@@ -88,10 +87,8 @@ export class AuthImpl implements AuthInternal, _FirebaseService {
88
87
_deleted = false ;
89
88
_initializationPromise : Promise < void > | null = null ;
90
89
_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 ;
95
92
readonly name : string ;
96
93
97
94
// Tracks the last notified UID for state change listeners to prevent
@@ -150,12 +147,7 @@ export class AuthImpl implements AuthInternal, _FirebaseService {
150
147
this . _isInitialized = true ;
151
148
} ) ;
152
149
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 ;
159
151
}
160
152
161
153
/**
@@ -191,7 +183,8 @@ export class AuthImpl implements AuthInternal, _FirebaseService {
191
183
popupRedirectResolver ?: PopupRedirectResolver
192
184
) : Promise < void > {
193
185
// 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 ;
195
188
if ( popupRedirectResolver && this . config . authDomain ) {
196
189
await this . getOrInitRedirectPersistenceManager ( ) ;
197
190
const redirectUserEventId = this . redirectUser ?. _redirectEventId ;
@@ -267,7 +260,8 @@ export class AuthImpl implements AuthInternal, _FirebaseService {
267
260
true
268
261
) ;
269
262
} catch ( e ) {
270
- this . redirectInitializerError = e ;
263
+ // Swallow any errors here; the code can retrieve them in
264
+ // getRedirectResult().
271
265
await this . _setRedirectUser ( null ) ;
272
266
}
273
267
@@ -419,7 +413,8 @@ export class AuthImpl implements AuthInternal, _FirebaseService {
419
413
[ _getInstance ( resolver . _redirectPersistence ) ] ,
420
414
KeyName . REDIRECT_USER
421
415
) ;
422
- this . redirectUser = await this . redirectPersistenceManager . getCurrentUser ( ) ;
416
+ this . redirectUser =
417
+ await this . redirectPersistenceManager . getCurrentUser ( ) ;
423
418
}
424
419
425
420
return this . redirectPersistenceManager ;
0 commit comments