-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error.credential is null if credential-already-in-use #1329
Comments
@Salakar your code use exception like this https://github.com/firebase/firebase-js-sdk/blob/master/packages/auth/src/error_auth.js but we should get an exception like this https://github.com/firebase/firebase-js-sdk/blob/master/packages/auth/src/error_withcredential.js with email and credentials |
@barbarosh the problem at the moment is that PhoneAuthCredentials aren't serializable both ways across the bridge, at least not on Android - @sowdri and I discussed this at length on the #authentication discord channel. We need to come up with a way of storing the token on the native side only and faking it on the JS side - with the real credential staying on native until it's consumed. The second bigger issue is that React Native errors (through promise rejections on native code) can only provide string code and message properties - you cannot add extra properties, in this case, a credential or something referencing one, so we'd have to make all Loving
|
Hey, not forgotten about this - I've been working on adding support in React Native for the second issue I mentioned above. Have just sent up a PR to React Native - so once/if this lands in a version we can start getting this supported. PR: facebook/react-native#20940 Loving
|
Hey, closing this and tracking in the following PR: Thanks |
Summary:
According to the docs, if the
linkWithCredential
fails, then theerror
should containerror.credential
which should be used in the subsequent call tosignInWithCredential
, but it's null.Quoted from the docs:
I'm using phone auth with anonymous login. So all users are authenticated anonymously at first, and during login, are linked with the credentials created using phone number and sms code. This works fine for new mobile numbers, however when the mobile number already exists, the linking fails, and I've to
signInWithCredential
instead, which is not possible at the moment, because theerror.credential
is null.Any help is appreciated,
Thanks,
The text was updated successfully, but these errors were encountered: