Regression | Hidden input not created when dispatching "verified" event · Issue #70 · altcha-org/altcha · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have implemented a "auto-submit" feature on my site using the "verified" event of the widget but the server is not receiving any input.
On the past I opened a issue (#10) because the hidden input was not created when triggering the "verified" event. This issue has again been introduced.
If I submit the form on the next tick, inside a setTimeout with delay 0, the input is received on the server.
How to reproduce the issue, create a form and add the following altcha widget.
Create a script (I'm using typescript) to initialize altcha.
import"altcha";document.addEventListener("DOMContentLoaded",(): void=>{constwidgets=document.querySelectorAll<HTMLElement>("altcha-widget");for(leti=0;i<widgets.length;i++){constwidget=widgets[i]asany;if(widget.hasAttribute("data-submit-verified")){widget.addEventListener("verified",onWidgetVerified.bind(widget));}}});functiononWidgetVerified(this: HTMLElement): void{constform=this.closest("form");if(!form){return;}// submit at this point does not workform.submit();// submit inside setTimeout works/*setTimeout((): void => { form.submit(); }, 0);*/}
Open the html and complete the challenge, the page will reload but no "altcha" input will be sent on the request
The text was updated successfully, but these errors were encountered:
I have implemented a "auto-submit" feature on my site using the "verified" event of the widget but the server is not receiving any input.
On the past I opened a issue (#10) because the hidden input was not created when triggering the "verified" event. This issue has again been introduced.
If I submit the form on the next tick, inside a setTimeout with delay 0, the input is received on the server.
How to reproduce the issue, create a form and add the following altcha widget.
Create a script (I'm using typescript) to initialize altcha.
Open the html and complete the challenge, the page will reload but no "altcha" input will be sent on the request
The text was updated successfully, but these errors were encountered: