Skip to content
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

Phone auth can lose verificationId with no way of getting it back #420

Closed
TikiTDO opened this issue Sep 18, 2017 · 1 comment
Closed

Phone auth can lose verificationId with no way of getting it back #420

TikiTDO opened this issue Sep 18, 2017 · 1 comment
Assignees

Comments

@TikiTDO
Copy link

TikiTDO commented Sep 18, 2017

Issue

When using firebase phone authentication, the app can lose a verificationId in between calls to signInWithPhoneNumber and _confirmVerificationCode.

This is touched upon in this comment.

Since signInWithPhoneNumber already passes the verificationId to JS-land, it would be nice to have an alternate validation function such as _confirmVerificationCodeWithId so that this lib would not have to worry about managing that part of the life cycle.

I can submit a PR for Android part, and I could half-ass it for iOS, but I figured it would be better to ask.

Environment

  1. Application Target Platform: Android (Though likely affects both)
  1. Development Operating System: Linux
  1. Build Tools: Android Oreo
  1. React Native version: 0.48.3
  1. RNFirebase Version: 3.0.0-alpha.3
  1. Firebase Module: auth
@chrisbianca
Copy link
Contributor

@TikiTDO See: #119 (comment) for information about what we're proposing in terms of a more bespoke API.

We're aware of the fact that the verificationId can be lost as part of the lifecycle of the apps in Android - though this is already handled in iOS.

You can already make use of the verificationId yourself using a PhoneCredential directly:

const credential = firebase.auth.PhoneAuthProvider.credential(verificationID, authCode);
return firebase.auth().signInWithCredential(credential)

Closing this as we'll pick up as part of #119

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants