Skip to content

Commit

Permalink
HACK - remove broken Captcha (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcpems authored Dec 19, 2024
1 parent 561e3fb commit 2880111
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
20 changes: 11 additions & 9 deletions src/lib/applications.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,22 @@ form.addEventListener("submit", (e) => {
e.preventDefault();
pageLoading(true);

var captchaVerificationToken = grecaptcha.getResponse();
if (captchaVerificationToken.length == 0) {
showSuccessAlert(successAlertId, false);
showErrorAlert(errorAlertId, errorAlertInnerElementId, true, ErrorMessages.MISSING_CAPTCHA_ERROR);
setTimeout(() => {
showErrorAlert(errorAlertId, errorAlertInnerElementId, false, "");
}, 3000);
} else {
// var captchaVerificationToken = grecaptcha.getResponse();
// if (captchaVerificationToken.length == 0) {
// showSuccessAlert(successAlertId, false);
// showErrorAlert(errorAlertId, errorAlertInnerElementId, true, ErrorMessages.MISSING_CAPTCHA_ERROR);
// setTimeout(() => {
// showErrorAlert(errorAlertId, errorAlertInnerElementId, false, "");
// }, 3000);
// } else
{
var data = new FormData(form)
fetch(`${import.meta.env.PUBLIC_API_HOST}${import.meta.env.PUBLIC_APPLICATION_API_ENDPOINT}`, {
method: "POST",
body: JSON.stringify({
"name": data.get("name"),
"token": captchaVerificationToken,
// "token": captchaVerificationToken,
"token": "",
"publisher": data.get("publisher"),
"requestType": data.get("report"),
"appCategories": data.get("categories") ?? "",
Expand Down
5 changes: 0 additions & 5 deletions src/pages/[lang]/contributing/applications.astro
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export function getStaticPaths() {
}
const locale = updateLanguage(Astro.url);
const recaptcha_url = `https://www.google.com/recaptcha/api.js?hl=${locale}`;
---

<BaseLayout
Expand Down Expand Up @@ -131,14 +130,10 @@ const recaptcha_url = `https://www.google.com/recaptcha/api.js?hl=${locale}`;
<label class="block text-font-color text-lg mb-1" for="icon_url">{t('application_form.icon.description')}</label>
<input class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" type="text" name="icon_url" id="icon_url" placeholder={t('application_form.icon.instruction')} />
</div>
<div class="mb-12">
<div class="g-recaptcha" data-sitekey=`${import.meta.env.PUBLIC_CAPTCHA_WEB_SITE_KEY}`></div>
</div>
<div class="mb-12">
<input type="submit" value={t('application_form.submit_button')} class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"></input>
</div>
</form>
</div>
</BaseLayout>
<script define:vars={{recaptcha_url}} src={recaptcha_url} async defer></script>
<script src="../../../lib/applications.js"></script>

0 comments on commit 2880111

Please sign in to comment.