Skip to content

Commit

Permalink
[fix] remove recaptcha references
Browse files Browse the repository at this point in the history
  • Loading branch information
gasper-az authored Dec 20, 2024
1 parent 7068170 commit bb94c2d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/lib/applications.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ form.addEventListener("submit", (e) => {
// 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",
Expand Down Expand Up @@ -93,7 +93,7 @@ form.addEventListener("submit", (e) => {
showErrorAlert(errorAlertId, errorAlertInnerElementId, false, '');
}, 3000);
})
};
// };
});

//######################################## Loader ########################################//
Expand Down
21 changes: 11 additions & 10 deletions src/lib/games.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,21 @@ 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_GAME_API_ENDPOINT}`, {
method: "POST",
body: JSON.stringify({
"name": data.get("name"),
"token": captchaVerificationToken,
// "token": captchaVerificationToken,
"token": "",
"publisher": data.get("publisher"),
"categories": data.get("categories") ?? "",
"compatibility": data.get("compatibility") ?? "",
Expand Down Expand Up @@ -65,7 +66,7 @@ form.addEventListener("submit", (e) => {
showErrorAlert(errorAlertId, errorAlertInnerElementId, false, '');
}, 3000);
})
}
// }
});

//######################################## Loader ########################################//
Expand Down
7 changes: 1 addition & 6 deletions src/pages/[lang]/contributing/games.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 @@ -134,15 +133,11 @@ const recaptcha_url = `https://www.google.com/recaptcha/api.js?hl=${locale}`;
<label class="block text-font-color text-lg mb-1" for="gamertag">{t('game_form.your_name_gamertag')}</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="gamertag" id="gamertag" />
</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('game_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/games.js"></script>
<script src="../../../lib/games.js"></script>

0 comments on commit bb94c2d

Please sign in to comment.