React-redux-firebase: bug(profile): createUser with profile-informations doesn't work with firestore

Created on 24 May 2018  路  3Comments  路  Source: prescottprue/react-redux-firebase

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

In my project i'am using

this.props.firebase.createUser({
  email: '[email protected]',
  password: 'admin'
}, {
  firstname: 'Foo',
  lastname: 'Bar'
})

to create an account, everything works fine, the user gets created - instant login and the flow works - except the adding of the second props (firstname, lastname) i don't know, they just get ignored.

EDIT:
I inject the firebase object into the component with withFirebase

I configured userProfile and useFirestoreForProfile in the store:

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

const createStoreWithFirebase = composeEnhancers(
  reactReduxFirebase(firebase, reactReduxFirebaseConfig),
  reduxFirestore(firebase)
)(createStore);

My firestore rules looking like that in the moment (for testing purposes i enabled everything)

service cloud.firestore {
  match /databases/{database}/documents {
    match /users/{userId} {
      allow read, write;
    }
  }
}

I also noticed that in no request - when creating a new user - the information from the second property is passed to the database:
screen shot 2018-05-24 at 08 11 21

Thats how a registered user looks in the users firebase document:
screen shot 2018-05-24 at 08 14 29

What is the expected behavior?

When creating an user with the createUser function the second property should add the passed information in the users/123123 document in firebase (firestore)

bug

Most helpful comment

Short update, i'am now using just the updateProfile directly after the createUser function, seems like that works fine :)

await createUser({ email, password });
await updateProfile({ firstname, lastname });

But i keep this issue open, since the documented way doesn't work

All 3 comments

Short update, i'am now using just the updateProfile directly after the createUser function, seems like that works fine :)

await createUser({ email, password });
await updateProfile({ firstname, lastname });

But i keep this issue open, since the documented way doesn't work

@michaelzoidl You are right about how it should work. Glad to hear you have a workaround.

Fixed by v2.2.0 release. Thanks for reporting!

Was this page helpful?
0 / 5 - 0 ratings