Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

346
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda