S sajal Active member Jan 29, 2024 #1 I have a custom POST route which is called from third party, so it's not possible to pass CSRF token. How to skip it? Because when I try to call it, it gives me 400 bad request security error.
I have a custom POST route which is called from third party, so it's not possible to pass CSRF token. How to skip it? Because when I try to call it, it gives me 400 bad request security error.
M Moritz Zimmerman Member Feb 20, 2025 #2 Were you able to solve this problem? I'm going through the same thing. Upvote 0 Downvote
Jeremy P XenForo developer Staff member Feb 22, 2025 #3 Be sure you understand the security implications, then override the controller method which checks it: PHP: /** * @param string $action */ public function checkCsrfIfNeeded($action, ParameterBag $params) { if (strtolower($action) == 'some-action') { return; } parent::checkCsrfIfNeeded($action, $params); } Upvote 0 Downvote
Be sure you understand the security implications, then override the controller method which checks it: PHP: /** * @param string $action */ public function checkCsrfIfNeeded($action, ParameterBag $params) { if (strtolower($action) == 'some-action') { return; } parent::checkCsrfIfNeeded($action, $params); }
MentaL Well-known member Feb 22, 2025 #4 Couldn't you not just use a CF rule to bypass on a specific target url? Upvote 0 Downvote