How do I use exception handler to catch a 419 page expired and convert it into other kind of exception if the route is contact form? #42663
Unanswered
ProteanCode
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there
I just made a trick to set the correct CSRF token on contact form if an user clicked on the submit button.
While most of the bots dont really send a click event to the button but deserializes the form into an HTTP request and sends it with curl, it may help fight spam emails.
The problem is there will be a lot of 419 exceptions thrown for every Chinese spambot crawling the site so I do want to somehow handle the case when a 419 exception has been thrown from route named ie. 'contactForm' and remap it into BotSpamException and discard it
Beta Was this translation helpful? Give feedback.
All reactions