Reply Error Interception |
(04-12-2020, 12:30 PM)Gary Wrote: Thanks Includebeer... I did start having a look at doing this, and although it was easy enough to find and change for a similar problem (for 429 response used by the Throttle class, which is in the App folder), when it comes to 403s (which are returned for the csrf filter), all I can find is what looks like the csrf form insertion functions in form_helper.php and Common.php and the palce where is thrown SYSTEMPATH/Security\Exceptions\SecurityException.php, which you'll note are all in the system directory and I'm reluctant- for a couple of reasons- to fiddle with). Definitely don't mess with the system directory. But you can override or extends a system class in your own app: https://codeigniter4.github.io/userguide...re-classes Maybe you could extend the Security class and just override the CSRFVerify() function to handle the exception like you want: PHP Code: public function CSRFVerify(RequestInterface $request)
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/ |
Messages In This Thread |
Reply Error Interception - by Gary - 04-06-2020, 01:20 PM
RE: Reply Error Interception - by Gary - 04-11-2020, 05:17 AM
RE: Reply Error Interception - by includebeer - 04-12-2020, 07:34 AM
RE: Reply Error Interception - by Gary - 04-12-2020, 12:30 PM
RE: Reply Error Interception - by includebeer - 04-12-2020, 02:03 PM
RE: Reply Error Interception - by Gary - 04-13-2020, 11:48 AM
RE: Reply Error Interception - by includebeer - 04-13-2020, 04:15 PM
RE: Reply Error Interception - by Gary - 04-14-2020, 01:27 PM
|