This repository was archived by the owner on Mar 17, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change 251251 return this . _initialAuthResolver . then ( function ( ) {
252252 // auth state may change in the future so rather than depend on the initially resolved state
253253 // we also check the auth data (synchronously) if a new promise is requested, ensuring we resolve
254- // to the current auth state and not a stale/initial state (see https://github.com/firebase/angularfire/issues/590)
254+ // to the current auth state and not a stale/initial state
255255 var authData = ref . getAuth ( ) , res = null ;
256- if ( authData !== null ) {
257- res = utils . resolve ( authData ) ;
258- }
259- else if ( rejectIfAuthDataIsNull ) {
256+ if ( rejectIfAuthDataIsNull && authData === null ) {
260257 res = utils . reject ( "AUTH_REQUIRED" ) ;
261258 }
262259 else {
263- res = utils . resolve ( null ) ;
260+ res = utils . resolve ( authData ) ;
264261 }
265262 return res ;
266263 } ) ;
267264 } ,
268265
269266 /**
270267 * Helper that returns a promise which resolves when the initial auth state has been
271- * fetch from the Firebase server. This never rejects and resolves to undefined.
268+ * fetched from the Firebase server. This never rejects and resolves to undefined.
272269 *
273270 * @return {Promise<Object> } A promise fulfilled when the server returns initial auth state.
274271 */
You can’t perform that action at this time.
0 commit comments