Skip to content

Conversation

@fredrivett
Copy link

@fredrivett fredrivett commented Mar 8, 2019

sorry, I created a PR before and deleted the repo by mistake, so ignore the other one

I've been messing about trying to combine react-redux-firebase-authentication with this react-firestore-authentication as I want to use both Redux and Firestore.

I've managed to do so by looking at the diffs in this repo, but one part kept erroring out.

For some reason my snapshot was returning without a data child, so if (!dbUser.roles) {...} was erroring out as dbUser was returning undefined.

I'm not sure if this is due to my setup being fresh, or wrong. But it seems to me this setup of setting the default roles in authUser and letting dbUser overwrite that if it has any is cleaner, as well as solving my problem.

I don't have a good grasp of the codebase here, so feel free to reject, but just submitting as it might help some folks.

I've been messing about trying to combine react-redux-firebase-authentication with this react-firestore-authenticationas I want to use both Redux and Firestore. I've managed to do so by looking at the diffs in this repo, but one part kept erroring out. For some reason my snapshot was returning without a data child, so line if (!dbUser.roles) {...} was erroring out as dbUser was returning undefined. I'm not sure if this is due to my setup being fresh, or wrong. But it seems to me this setup of setting the default roles in authUser and letting dbUser overwrite that if it has any is cleaner, as well as solving my problem. I don't have a good grasp of the codebase here, so feel free to reject, but just submitting as it might help some folks.
@fredrivett
Copy link
Author

Also, if helpful I can push up my repo which uses Firestore and Redux, just let me know if so. Seems to work though I've not tested it much just yet.

@rwieruch
Copy link
Member

Thanks for helping out with this. See my comment over here: #9 (comment) Not sure whether this PR fixes the problem.

@rwieruch rwieruch closed this Apr 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants