Auth not populated on 2nd authorize
See original GitHub issueWhen I authorise user that has already been logged into the database, like so:
this.props.firebase.login({
email: existing_user@gmail.com',
password: 'trees'
})
…the first time it happens, this.props.auth
is populated with the user info, and the rest of the props (e.g. todos
) are received from firebase as I would hope and subsequently render to the page.
Then, when I call firebase.logOut()
, this.props.auth
returns null
again, and the rest of the props disappear. Again, this is the desired result.
It’s when I call login()
a second time that the problem occurs. The auth
object is populated again like last time, but the rest of the props such as todo
are not received. I tried setting the “rules” object in the console to the ‘PUBLIC’ setting to rule out any permissions restrictions being part of the problem but I got the same response.
The only difference in how redux receives the state from firebase between auth
and todos
is auth uses pathToJS
, and todos uses dataToJS
- could this be part of the problem?
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (7 by maintainers)
Top GitHub Comments
@prescottprue thank you for your help. I tried different variations of ‘/todos’ and ‘todos’ and it didn’t resolve my issue. After more testing todos do not populate until user is authorized and I refresh the page. This probably something I’ve done to mess it up. I have not implemented componentShouldUpdate anywhere. I will open a new issue if this isn’t some dumb mistake I’ve made. Thanks again.
@jarbot No you don’t have to manually call
dataToJS
. Your syntax should work.Try using
/todos
in yourdataToJS
call to match what you pass tofirebaseConnect
, or change what you pass tofirebaseConnect
totodos
(no slash).This issue ended up being due to usage of
componentShouldUpdate
before, so you might be seeing something different.Please open a new issue that has what version number you are using, and an example to reproduce the error.