firebase / firebase/quickstart-js
The "Send Code" button for MFA is never enabled even after entering valid phone number and successful recaptcha
- Dominant language
- TypeScript
- Stars
- 5.4k
- Forks
- 3.7k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 6
Description
I'm trying to run the the MFA authentication example on Firebase Hosting. After signing up a user and verifying the email, when I click the "Enroll" button and enter a valid phone number (+971XXXXXXX) and successfully do the recaptcha (I see a green check mark), the "Send Code" button remains disabled. Upon debugging, it seems the issue is is in line 396 of the "mfa-password.js" file because the grecpatcha variable is undefined whereas the recaptchaWidgetId variable is not null. So the if condition fails and the function returns false. If I modify the isCaptchaOK() function to simply return true (hardcoded), then the button becomes enabled and I'm able to successfully receive a verification code on my phone.
I'm not a recpatch expert but it doesn't seem like there's anywhere in the mfa-password.js where the grecpatch variable is being initialized. Am I missing something or is this variable somehow initialized by the recaptcha library? If so, why isn't it working in my case?
Contributor guide
Assessment
This issue has not been assessed yet.