firebase / firebase-js-sdk

Firebase Javascript SDK
https://firebase.google.com/docs/web/setup
Other
4.83k stars 891 forks source link

There is no event on click outside of recaptcha #2636

Closed ruslanakholod closed 4 years ago

ruslanakholod commented 4 years ago

Environment

Describe the problem

I use phone authorization of firebase in my application When user clicks at 'Login' button I switch form to the 'Loading state' (which makes 'Login' button disabled) and call firebase.auth().signInWithPhoneNumber(phone, recaptcha) function to authorize user. Sometimes firebase opens Recaptcha to verify user's identity. However, if user clicks outside of Recaptcha, it is hiding and no event is triggered, what makes impossible to switch form back to 'Normal state'

Steps to reproduce:

  1. Make a button which signs in user with phone provider by clicking on it and switches to disabled state immediately after the click
  2. Click at the button and see Recaptcha
  3. Click outside of Recaptcha to hide it

Actual result: 'Sign in' button is disabled. There is no way to make it enabled (no event for that)

Expected result: There is an event to know if users clicked outside of recaptcha (which hides it)

Relevant Code:

https://stackblitz.com/fork/firebase-issue-sandbox

const sendCode = (phone: string) => {
  return firebase
    .auth()
    .signInWithPhoneNumber(phone, recaptcha)
    .then(rsp => rsp.verificationId)
}

// sendCode() returns a promise which will be Pending forever if user clicks outside of Recaptcha
rommelpe commented 4 years ago

Sorry for the late response, @ruslanakholod. I'm not sure if that's the recaptcha's expected behavior. I tried reproducing it using quickstart, the recaptcha never gets hidden at all. If you could provide a working repro, that would be a big help for us to start with.

google-oss-bot commented 4 years ago

Hey @ruslanakholod. We need more information to resolve this issue but there hasn't been an update in 7 days. I'm marking the issue as stale and if there are no new updates in the next 3 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot commented 4 years ago

Since there haven't been any recent updates here, I am going to close this issue.

@ruslanakholod if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.