Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

383
Visualizações
Uncaught (in promise) FirebaseError: Firebase: Error (auth/missing-code)

Trying to implement Fireship's firebase 2fa in firebase v9

const verifyOTP = async () => {
    const code = otpRef.current.value
    if (code.length >= 6) {
        const cred = await new PhoneAuthCredential({
        verificationId: window.verificationId,
        smsCode: code
    })
    const multiFactorAssertion = PhoneMultiFactorGenerator.assertion(cred)
    await multiFactor(user).enroll(multiFactorAssertion, phoneNumber)
    alert('opted-in to 2FA')
    }
}

it doesn't like this line:

await multiFactor(user).enroll(multiFactorAssertion, phoneNumber)

because it thinks that the smsCode is missing, even though it's clearly in there. I got the same error for missing verificationId, but putting it in a JSON object and making it the key fixed that, and yet, still getting Error (auth/missing-code).

assert.ts:122 Uncaught (in promise) FirebaseError: Firebase: Error (auth/missing-code).
    at createErrorInternal (assert.ts:122:1)
    at _fail (assert.ts:65:1)
    at _performFetchWithErrorHandling (index.ts:170:1)
    at async _logoutIfInvalidated (invalidation.ts:32:1)
    at async MultiFactorUserImpl.enroll (mfa_user.ts:61:1)
    at async verifyOTP (OptIn2FA.js:101:1)
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda