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

341
Views
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 answers
Answer question

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 Report
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!