I have several errors in my project when an user logs out.
The errors are like this:
Notifying id token listeners about a sign-out event.
D/FirebaseAuth( 8062): Notifying auth state listeners about a sign-out event.
W/Firestore( 8062): (24.7.0) [Firestore]:
Listen for Query(target=Query(users where
uid==U1bS1arrd4PvLH4bmt8sIXg0aAH3 order by __name__);limitType=LIMIT_TO_FIRST)
failed: Status{code=PERMISSION_DENIED, description=Missing or
insufficient permissions., cause=null}
I have a bloc/cubit architecture.
2
Answers
Go in Database -> Rules ->
For development:
For production:
You can also review it from the Firebase documentation. https://firebase.google.com/docs/firestore/security/get-started
If you need a Sign Out code, you can also use this. I hope I have helped. Enjoy your work.
From the error message it seems that you have a realtime listener to some data in Firestore, and you have set up your security rules to only allow reading that data when/while the user of the app is signed in to Firebase Authentication.
When you sign out, the user no longer meets the requirement of your security rules, and the listener gets cancelled because of that.
If you want to prevent getting the error message, you will have to remove the listener(s) before signing out the user.