armand1m / react-with-firebase-auth

Higher-Order Component for integrating Firebase Authentication methods with a React Component through props
https://armand1m.github.io/react-with-firebase-auth/
MIT License
130 stars 31 forks source link

signInWithEmailAndPassword return undefined #87

Closed ProjectINT closed 3 years ago

ProjectINT commented 4 years ago

Describe the bug signInWithEmailAndPassword = (email: string, password: string) => { this.tryTo<firebase.auth.UserCredential>(() => firebaseAppAuth.signInWithEmailAndPassword(email, password), ); }; signInWithEmailAndPassword return undefined

To Reproduce Steps to reproduce the behavior: Try to catch the error. (in props only message string)

Expected behavior signInWithEmailAndPassword(l.p).catch(error => console.log('error', error))

Additional context This behavior is not convenient for internationalization. How to translate the error messages? In your source looks like you wanted to return error object, and pass a message to props, but have bug.

seanburlington commented 4 years ago

Ah I have the same issue

I want to take further steps after creating user and save additional profile data

But I can't signInWithEmailAndPassword(l.p).then((user) => { /save additional user data/ } )

and I'd also like to handle errors with .catch()

ProjectINT commented 4 years ago

seanburlington, I fix it and send pull request, but at now I think to write own module because it's not one problem that I see in this package, you can look my pull request, I fix the problem then I use "npx patch-package ..." to use fixes.

joseph-allen commented 4 years ago

This looks good to me, can we get it merged?

It's a little useless to have a login function where we can't access the errors. For now, my App has two logins, one I handle myself through my API, and one that uses this since I can't manage errors.

armand1m commented 3 years ago

as @ProjectINT PR's got merged quite a while ago and this issue got stale, I assume this is fixed