Mulitgrid Security Errors ( CSRF?)

I’m working with CodeIgniter 4 trying to use multigrid for two cruds but keep getting security errors like the ones below. When I make an exception to csrf in filters for this file and csrf for POST the errors stop and it works beautifully. My assumption is that I have some issue with csrf because disabling it seems to solves my problems. Is there anyway I can keep my csrf protections?

My error
Error: Forbidden.
Server Response:
{
“title”: “CodeIgniter\Security\Exceptions\SecurityException”,
“type”: “CodeIgniter\Security\Exceptions\SecurityException”,
“code”: 403,
“message”: “The action you requested is not allowed.”,

My code

public function multigrid() {
	
	
	$crud = $this->_getGroceryCrudEnterprise();
	$crud->setCsrfTokenName(csrf_token());
            $crud->setCsrfTokenValue(csrf_hash());
	$crud->setApiUrlPath('/forms.php/Guest/testgrid1');
	$output = $crud->render();

	$crud2 = $this->_getGroceryCrudEnterprise();
	$crud2->setCsrfTokenName(csrf_token());
            $crud2->setCsrfTokenValue(csrf_hash());
	$crud2->setApiUrlPath('/forms.php/Guest/testgrid2');
	$output2 = $crud2->render();

	$output->output .= '<br/>' . $output2->output;

	return $this->_example_output($output);
	
	
	
}

public function testgrid1(){
	$crud = $this->_getGroceryCrudEnterprise('registration');

            $crud->setCsrfTokenName(csrf_token());
            $crud->setCsrfTokenValue(csrf_hash());
		
	$crud->setTable('guests');
	$output = $crud->render();

return $this->_example_output($output);
	
	
}

public function testgrid2(){
	$crud = $this->_getGroceryCrudEnterprise('registration');

            $crud->setCsrfTokenName(csrf_token());
            $crud->setCsrfTokenValue(csrf_hash());
		
	$crud->setTable('chinacompany');
	$output = $crud->render();

return $this->_example_output($output);
	
	
}

Hello @iradave ,

Just a quick update that I am still investigating on this. Seems that from the new version onwards, I will need to have a global csrfToken in JavaScript. But even this is a bit more complicated because on multiple requests sent at the same time this may be an issue. I will update you to soonest I have some news on that.

Regards
Johnny

Hello @iradave

I am glad to inform you that this is now fixed at the latest version 3.2.3 , you can upgrade to the latest version following the wizard instructions easily: User's Page Login

Regards
Johnny