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

350
Visualizações
Recaptcha call back can be found when it is the only function but not when other ones are included

I am trying to make a discord bot verification page where users verify that they are not a robot. I have run into an error where Recaptcha cannot find my recaptchaCallBack function. It recognizes it when it is the only function and doesn't when other functions are included.

Here is the code:

import { initializeApp } from "https://www.gstatic.com/firebasejs/9.6.4/firebase-app.js";
            import { getAnalytics } from "https://www.gstatic.com/firebasejs/9.6.4/firebase-analytics.js";
            import { getDatabase } from "firebase/database";
            // TODO: Add SDKs for Firebase products that you want to use
            // https://firebase.google.com/docs/web/setup#available-libraries

            // Your web app's Firebase configuration
            // For Firebase JS SDK v7.20.0 and later, measurementId is optional
            const firebaseConfig = {
                //config
            };

            // Initialize Firebase
            const app = initializeApp(firebaseConfig);
            const analytics = getAnalytics(app);
            const db = getDatabase();
            
            function recaptchaCallback() {
                set(ref(db, "verified/" + userVarFormatted), {
                    name: userVarSplitted[0],
                    discriminator: userVarSplitted[1]
                });
            }
<html>
    <head>
        <title>Jerry Bot Verication</title>
        <script src="https://www.google.com/recaptcha/api.js" async defer></script>
    </head>
    <body>
      <form action="?" method="post" data-callback="XXX" class="recaptchaDIV">
            <div class="g-recaptcha" data-callback="recaptchaCallback" data-sitekey="my site key"></div>
        </form>
      <!--My js code was here-->
    </body>
</html>

Do you know what is causing this? Thanks

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

If you're talking about just a regular web page, there's no mechanism for require("mongodb") to work. (You'd need a bundler.)

Even if it did, a browser can't directly talk the MongoDB protocol.

Even if it could, you'd now expose your MongoDB credentials to anyone who would visit the page, so they could read and tamper with your database however they'd like, which is likely not what you want.

about 4 years ago · Juan Pablo Isaza Relatório
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