Open mnindrazaka opened 6 years ago
+1 happens to me too, using React web
I'm seeing the same thing.
this.props.firebase.login
always seems to be triggering @@reactReduxFirebase/LOGIN_ERROR
For me, I was able to use the standard firebase login and react-redux-firebase still caught the auth change and updated the auth and profile state.
firebase
.auth()
.signInWithEmailAndPassword(email, password)
.then(user => console.log(user));
const credential = firebase.auth.EmailAuthProvider.credential(
email,
password
);
firebase
.auth()
.signInWithCredential(credential)
.then(user => console.log(user));
@ytwater LOGIN_ERROR
is dispatched with null
to reset error state when logging in.
I'm look into this.
I had the same issue, the problem was the order of functions in redux compose, see example below:
// doesn't work, react-redux-firebase actions are not dispatched
const store = createStore(
rootReducer,
compose(
composeWithDevTools(),
reactReduxFirebase(firebase, config),
reduxFirestore(firebase),
applyMiddleware(thunk.withExtraArgument(getFirebase))
)
);
// works
const store = createStore(
rootReducer,
compose(
applyMiddleware(thunk.withExtraArgument(getFirebase)),
reactReduxFirebase(firebase, config),
reduxFirestore(firebase),
composeWithDevTools()
)
);
I hope it helps! :)
@krzysu Great to know that solves it, thanks for reaching out. Seems like it is caused by the same thing causing #400.
Running into this error on a project of ours currently, tried switching the order of compose and that didn't seem to do the trick either.
@GioLogist Which version are you using? Did you try installing from the @next
tag?
@prescottprue Sorry for the delay - actually fixed it immediately after and forgot to update!
Was my foolish mistake. Forgot to initialize firebase before setting up the store 😝 (was a long day, i swear!)
I'm having the same issue with on v3
. It appears as though authActions.init
never gets invoked so there is no listener setup for successful logins. I'm not sure where the functionality from enhancer.js
is intended to map to in the new version, but that operation and createAuthIsReady
seem to be missing currently.
@gotdibbs Thanks for the detailed reporting - I'm going to look into calling that as part of the provider for v3
@gotdibbs v3.0.0-alpha.4 now includes auth initialization in the Providers, but I don't believe that addresses this issue, so going to leave it open.
when i tried to use auth with login() and try to shows auth props, i got this
but when i use createUser() i got this auth props
this is my login() code
this is my createUser() code
and this is how i attach auth props to a component
i use react native and react-native-firebase