Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

313
Views
Recaptcha está funcionando, el correo electrónico está verificado, 2FA activado en la consola... pero auth/error interno al ejecutar .verifyPhoneNumber()

Revisé otras publicaciones de StackOverflow y no he visto nada que solucione el problema. Estoy tratando de configurar la autenticación multifactor para mi aplicación. Por lo que he entendido, los pasos básicos son:

  1. Habilite 2FA en Firebase Console y Google Cloud Console ✔️
  2. Configura un reCaptcha ✔️
  3. Consigue la sesión ✔️
  4. Y envía un mensaje de verificación con phoneAuthProvider.verifyPhoneNumber ❌

No estoy seguro de por qué, ya que todo lo que obtengo es FirebaseError: Firebase: Error (auth/internal-error)

Importaciones

 import 'firebase/auth'; import * as firebase2 from 'firebase/auth'; import firebase from 'firebase/compat/app'; import 'firebase/compat/auth'; import firebaseApp from '../../../../src/config'; import { getAuth } from 'firebase/auth';

Aquí está el resumen:

 useEffect(() => { try { const auth22 = getAuth(); // Recaptcha only ran once, stored in state const recaptchaVerifier = new firebase2.RecaptchaVerifier( 'multifactor-form', { size: 'invisible', callback: (response) => { console.log('successfully created the captcha'); console.log(response); }, }, auth22 ); console.log(recaptchaVerifier); setCaptchaVerifier(recaptchaVerifier); } catch (e) { console.log(e); } }, []);

Y aquí está la función que ejecuto cuando hago clic en enviar SMS:

 const sendSMS = async function (phoneNumber: any) { console.log(phoneNumber); console.log(typeof phoneNumber); try { let verificationId: any; const auth = firebaseApp.auth(); const user = auth.currentUser; const newNumber: string = `+1${phoneNumber}`; const session = await user.multiFactor.getSession(); const phoneOpts = { newNumber, session, }; const phoneAuthProvider = new firebase.auth.PhoneAuthProvider(); verificationId = await phoneAuthProvider.verifyPhoneNumber(phoneOpts, recaptchaVerfifier); //Nothing runs after the line above this one alert('sms text sent!'); } catch (e) { console.log(e); } };

¿Alguien puede ver algo malo en lo que estoy haciendo?

Si es necesario, aquí están los tutoriales y guías que he estado siguiendo junto con:

https://fireship.io/lessons/two-factor-auth-firebase/#identity-platform

https://cloud.google.com/identity-platform/docs/web/mfa?_ga=2.210928085.-1381314988.1638978774

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!