prescottprue / react-redux-firebase

Redux bindings for Firebase. Includes React Hooks and Higher Order Components.
https://react-redux-firebase.com
MIT License
2.55k stars 559 forks source link

bug(profile): provider login not creating user profile #621

Open sambokai opened 5 years ago

sambokai commented 5 years ago

Bug

What is the current behavior?

Logging in using this.props.firebase.login({provider: 'google', type: 'redirect'}); does not create a user profile in firestore. Using E-Mail & Password with the same config and environment does create user profiles.

My Config:

export const reduxFirebaseConfig = {
    useFirestoreForProfile: true,
    userProfile: 'users',
};

firebase.initializeApp(firebaseConfig);
firebase.firestore();

export const rrfProps = {
    config: reduxFirebaseConfig,
    createFirestoreInstance,
    dispatch: store.dispatch,
    firebase,
};
<ReactReduxFirebaseProvider {...rrfProps}>
   ...
</ReactReduxFirebaseProvider>

Firestore Security Rules : Set to 'Allow All' for debugging purposes

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if true;
    }
  }
}

What is the expected behavior?

User profile should be created upon logging in with a Provider.

Which versions of dependencies, and which browser and OS are affected by this issue? Did this work in previous versions or setups?

Mac OS, Chrome Version 71.0.3578.98 (64bit)

"firebase": "^5.8.0",
"react-redux-firebase": "^3.0.0-alpha.6",
"redux-firestore": "^0.6.3",
"redux": "^4.0.1",
"react": "^16.5.1",
"react-dom": "^16.5.1",

Related: https://github.com/prescottprue/react-redux-firebase/issues/33

prescottprue commented 5 years ago

Thanks for reporting! I'll look into trying to replicate. Not sure it would impact anything, but you may want to try using the new version of redux-firestore available from the alpha tag (it was made to work with the new react-redux-firebase).

jamesjryan commented 5 years ago

Hey @prescottprue - I'm also experiencing this. I've got the following versions working together and experiencing the same issue - please advise if this isn't a viable configuration.

    "firebase": "^5.8.3",
    "redux-firestore": "^0.6.4",
    "react": "^16.8.2",
    "react-dom": "^16.8.2",
    "react-redux-firebase": "3.0.0-alpha.9",

If this is a bug - can you point me in the direction of which library you suspect the regression is in, or which library you intended on implementing this in, and I'll have a go at putting a PR together.

I intend to make considerable use of this library and would like to help move both alpha versions closer to a release if possible.

prescottprue commented 5 years ago

@jamesjryan It is in this library (react-redux-firebase). You will want to make updates for the alpha version in PRs that are against the next branch.

tomoyuki28jp commented 4 years ago

I'm also experiencing this. Any progress?

Chbe commented 4 years ago

Same problem here.

"firebase": "^6.4.0",
"react-firebaseui": "^4.0.0",
"react-redux": "^7.1.0",
"react-redux-firebase": "^3.0.0-alpha.16",
"redux-firestore": "^0.8.0"
dparrelli commented 4 years ago

Looks like this issue is specific to type: 'redirect'. If you change the type to be popup instead, it works.

eg.

firebase.login({
  provider: 'google',
  type: 'popup'
})

Here are the versions I'm using:

"firebase": "^7.5.1",
"react-redux": "^7.1.3",
"react-redux-firebase": "^3.0.5",
"redux-firestore": "^0.11.0"
SKempin commented 4 years ago

I am experiencing this with signInWithPopup with Google as the provider. Has there been any progress?

    "firebase": "^7.13.2",
    "react-dom": "^16.13.1",
    "react-redux": "^7.2.0",
    "react-redux-firebase": "^3.3.0",