Welcome Guest, Not a member yet? Register   Sign In
Problems with POST in RestFul API
#5

(07-10-2021, 05:04 AM)wspock Wrote: Greetings. I found that this happens when I enable the CSRF filter (I need to implement token).

Yes, the CSRF filter does a redirect when the token is not valid:
PHP Code:
redirect()->back()->with('error'$e->getMessage()); 

You can display that error on your page like this:
PHP Code:
<?php if (session('error') !== null) : ?>
<?= session
('error'?>
<?php 
endif; ?>
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply


Messages In This Thread
Problems with POST in RestFul API - by wspock - 07-09-2021, 01:04 PM
RE: Problems with POST in RestFul API - by wspock - 07-09-2021, 02:19 PM
RE: Problems with POST in RestFul API - by wspock - 07-10-2021, 05:04 AM
RE: Problems with POST in RestFul API - by includebeer - 07-11-2021, 06:15 AM
RE: Problems with POST in RestFul API - by paliz - 07-11-2021, 11:06 AM



Theme © iAndrew 2016 - Forum software by © MyBB