redux-react-firebase icon indicating copy to clipboard operation
redux-react-firebase copied to clipboard

User profile is undefined

Open gazpachu opened this issue 7 years ago • 1 comments

I'm following the auth example, but the user profile comes as undefined, although the auth object is fine:

@firebase()
@connect(
  	(state, props) => ({
		user: pathToJS(state.firebase, 'auth'),
		profile: pathToJS(state.firebase, 'profile')
  	})
)
const createStoreWithFirebase = compose(
    reduxReactFirebase(firebaseConfig, {userProfile: 'users'}),
	window.devToolsExtension ? window.devToolsExtension() : f => f
)(createStore);

I've also tried without the devTools stuff, but no luck.

I do have the 'users' node in my Firebase database, although no ID is being created in the 'users' node when using firebase.createUser(credentials, { name.value }), which might be the real cause of the issue...

BTW, in the docs says: "profile if initialized with userProfile support then profile will be saved into ${userProfile}/${auth.uid}", so that means it should create the new key in the 'users' node.

I've also tried to rename userProfile to profile in the store, but it doesn't make any effect:

reduxReactFirebase(firebaseConfig, {profile: 'users'}),

gazpachu avatar Jan 07 '17 09:01 gazpachu

@gazpachu I was having this same problem, looking at the source for reduxReactFirebase it only accepts one object. If you merge the firebase config with { userProfile: 'users' } then it works.

webbushka avatar Feb 18 '17 20:02 webbushka