-
Notifications
You must be signed in to change notification settings - Fork 898
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
OTP Not Received When Using signInWithPhoneNumber on Cloud Server #8610
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
We are having this same issue, however it doesn't work locally either. We upgraded from 10.14.0 (the last version that works) to 11.0.1 (we also tried 10.14.1 and that only worked for a day and half) and MFA broke completely. It no longer provides the error.resolve and just returns undefined in the catch error instead. We are using the namespaced/compat variant, however that shouldn't matter due to the way the compat version is configured in the SDK codebase. Has there been any progress into this? Update Further investigation has lead to a potential recaptcha issue in where the api.js isn't being loaded causing it not to load the recaptchaParams config, which then leads to it not being able to call the reload for the recaptcha key and thus finally not allowing MFA token not to be sent. We are still investigating and trying to find a fix / workaround. I will keep this ticket updated. We have also noticed around the midnight rollover for the USA (to Sydney time) is when it seems to start to break for 10.14.1 |
Hi @oardila, thanks for filing the issue. I've tried reproducing the issue with an app deployed to Firebase Hosting, but the SMS OTP code is sent successfully (v11.0.1 modular).
If you think this isn't an SDK bug, I would suggest contacting Firebase Support so that backend team can debug the issue. Edit I noticed you are initializing |
Hi @moderniselife, thanks for sharing your problem. I've tried reproducing the issue with v11.0.1 compat libraries both locally and with an app deployed to Firebase Hosting, but the SMS OTP was sent successfully in both cases. In the network log, do you see the API call (
Could you please elaborate on how you know the recaptcha api.js script is not loading?
The fact that it's working on 10.14.0 and started breaking in 10.14.1 suggests that this is an SDK issue. However, if it were truly an SDK issue, it should consistently fail in 10.14.1, not work intermittently as you described. While we made changes to the phone auth flows in 11.0.0, I don't believe those changes are the cause, as the issue appeared in 10.14.1. |
Operating System
Linux Ubuntu
Environment (if applicable)
Vercel
Firebase SDK Version
11.0.1
Firebase SDK Product(s)
Auth, Messaging
Project Tooling
Detailed Problem Description
signInWithPhoneNumber
function works seamlessly in the local development environment but fails to deliver the OTP when deployed on the cloud.Steps and code to reproduce issue
1. Create a Minimal Next.js Application
Set up a new Next.js application (if you don't have one already):
npx create-next-app@latest firebase-otp-test cd firebase-otp-test
2. Install Firebase Dependencies
Install Firebase SDK:
3. Configure Firebase
Create a
firebase.ts
file in theservices
directory to initialize Firebase:firebaseConfig
with your actual Firebase project credentials._4. Implement the OTP Login Component
Create a simple OTP login component using Firebase's
signInWithPhoneNumber
:5. Test Locally
Run the Application Locally:
Access the Login Page:
http://localhost:3000/#
.6. Deploy to Cloud Server
For example, deploy to Vercel:
The text was updated successfully, but these errors were encountered: