Skip to content

feat(core): usage with 2 firebase projects #579

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
compojoom opened this issue Dec 4, 2018 · 2 comments
Open

feat(core): usage with 2 firebase projects #579

compojoom opened this issue Dec 4, 2018 · 2 comments

Comments

@compojoom
Copy link
Contributor

I'm trying to move our firestore data to a different region and for this I created a new project.
I'm planning to use the old project to authenticate the users, then with custom claim authenticate them in the new project. We use firestore for profile. the authentication part works. I can also store data in the new project, but react-redux-firebase has difficulties populating with the correct firestore user profile.

I'm creating my store like this:
const enhancer = composeEnhancers(
reactReduxFirebase(firebase, reduxFirebaseConfig),
reduxFirestore(firebaseEU),
applyMiddleware(...middleware)
)

const store = createStore(persistedReducer, initialState, enhancer)

if I use firestoreConnect - it appears to read the data from the new project. But the updateProfileInfoOnLogin uses the user's config from the old project.

@prescottprue - I understand that this is rather tricky. reactReduxFirebase doesn't know anything about the reduxFirestore config, so I guess that this is the reason it assumes it should use the firebaseconf instead of the redux conf passed to reduxFirestore. What do you think?

@prescottprue
Copy link
Owner

Interesting use case. I wondering if it would respond the same if you placed reduxFirestore before reactReduxFirebase.

Current Solution Option: You can use two stores and have one app in each then use createFirebaseConnect or createFirestoreConnect and pass the key of the store (defaults to 'store').

Support of multiple apps is something that others have requested, so I'm going to make sure to add that to the list of features that should be part of the next major version. Thanks for reaching out!

@prescottprue
Copy link
Owner

Added this to the proposed features of the 3.0.0 roadmap.

@prescottprue prescottprue added this to the v3.0.* milestone Jan 15, 2019
@prescottprue prescottprue changed the title Usage with 2 firebase projects feat(core): usage with 2 firebase projects Feb 8, 2019
@prescottprue prescottprue modified the milestones: v3.0.*, Future Versions Sep 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants