Feat: Update CAPTCHA service to ALTCHA self-hosted.
This commit is contained in:
3651
static/dist/js/main.bundle.js
vendored
3651
static/dist/js/main.bundle.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,5 +1,7 @@
|
||||
|
||||
// internal
|
||||
import BasePage from "../base.js";
|
||||
// vendor
|
||||
import { Altcha } from "../../vendor/altcha.js";
|
||||
|
||||
export default class PageContact extends BasePage {
|
||||
static hash = hashPageContact;
|
||||
@@ -10,11 +12,12 @@ export default class PageContact extends BasePage {
|
||||
|
||||
initialize() {
|
||||
this.sharedInitialize();
|
||||
this.hookupCaptcha();
|
||||
// this.hookupALTCHAByLocalServer();
|
||||
this.hookupButtonSubmitFormContactUs();
|
||||
}
|
||||
|
||||
hookupCaptcha() {
|
||||
/*
|
||||
hookupALTCHAByAPI() {
|
||||
const form = document.querySelector(idContactForm);
|
||||
const altchaWidget = form.querySelector('altcha-widget');
|
||||
|
||||
@@ -35,6 +38,22 @@ export default class PageContact extends BasePage {
|
||||
});
|
||||
}
|
||||
}
|
||||
*/
|
||||
hookupALTCHAByLocalServer() {
|
||||
window.ALTCHA = { init: (config) => {
|
||||
document.querySelectorAll(config.selector).forEach(el => {
|
||||
new Altcha({
|
||||
target: el,
|
||||
props: {
|
||||
challengeurl: config.challenge.url,
|
||||
auto: 'onload'
|
||||
}
|
||||
}).$on('verified', (e) => {
|
||||
config.challenge.onSuccess(e.detail.payload, el);
|
||||
});
|
||||
});
|
||||
}};
|
||||
}
|
||||
|
||||
hookupButtonSubmitFormContactUs() {
|
||||
const button = document.querySelector('form input[type="submit"]');
|
||||
|
||||
Reference in New Issue
Block a user