Quantcast
Channel: User Chris - Stack Overflow
Viewing all articles
Browse latest Browse all 39

Answer by Chris for AngularFire Missing or insufficient permissions on login, works after refresh

$
0
0

I was able to solve the error by replacing the standard subscription with a switchMap

constructor(  private angularFireAuth: AngularFireAuth,  private firestore: AngularFirestore,) {  this.angularFireAuth.authState    .pipe(      switchMap((authUser) =>        authUser          ? this.firestore.collection('user').doc(authUser.uid).collection<Repository>('repositories').valueChanges()          : of([])      )    )    .subscribe(this.repositories$);}

I think the root of the problem was with the firebase listener trying to fetch documents during/after the logout process which was causing it to error out.

This would explain why refreshing the page between login sessions solves.

Awkward.


Viewing all articles
Browse latest Browse all 39

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>