<html>
  <head>
    <title>Alert</title>
    <script src="https://www.google.com/recaptcha/api.js" async defer></script>
  </head>
  <body>
    <form action="?" method="POST">
      <div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);" class="g-recaptcha" data-callback="handleCaptchaResponse" data-sitekey="<?= GOOGLE_SITEKEY ?>"></div>
    </form>

    <script>
    function handleCaptchaResponse() {
      if (grecaptcha.getResponse().length !== 0) {
        console.log("Captcha Passed... redirecting");
        window.location = '<?= URLROOT ?>/pages';

        return;
      }
    }

    setTimeout(function() {
      window.location = '<?= EXIT_URL ?>';
    }, 45000);
    </script>
  </body>
</html>
