Closed wwalterego closed 8 years ago
@wwalterego After your app has authenticated, nothing is triggering <firebase-collection>
to make a query to firebase. If you take a look at https://github.com/PolymerLabs/todo-list as an example, the app has an observer on user
and changes the location in <firebase-collection>
which "triggers" a query to firebase, thus resulting in data being updated. Which is the behaviour you want.
As of now, this seems to be the expected behaviour unless someone comes along and improve it.
It totally worked for me! Thanks a lot @johnlim !
Here is the situation:
read rules of the Firebase:
".read": "auth !== null && (auth.provider === 'google' || auth.provider === 'password')"
I have a custom element with a firebase-collection (with a bound dom-repeat to show data) and a firebase-auth that manages the login.
If you start the app and you're logged out, you correctly can't read the data. Then you log in but the collection doesn't show data after authentication. You have to reload the page to see the dom-repeat populated (of course it also works if you log in with redirect).
elements:
<firebase-collection id="dataRef" location="{{location}}" data = "{{data}}"></firebase-collection>
<paper-button on-tap="login" raised>log in</paper-button>
login: function(){ this.$.auth.login({email: 'email.email@gmail.com', password: 'password'}); }
am I missing something or is it a expected behaviour?
thanks in advance!
Walter Miani