agungsugiarto / boilerplate

CodeIgniter4 Boilerplate based on AdminLTE 3 with user management, roles, permissions, ...
MIT License
155 stars 49 forks source link

Undefined property: Config\App::$CSRFHeaderName #111

Open hilmanmustofaa opened 11 months ago

hilmanmustofaa commented 11 months ago

After all prerequisite step, i was able to open the login page. But, when i was tried to login. There is error page with this message "Undefined property: Config\App::$CSRFHeaderName" shown below picture:

image

I have tried to search about the issue, there is similar issue in the myth/auth github issue page : https://github.com/lonnieezell/myth-auth/issues/125 . And i try to do same as the author answer but the issue still exist.

Can someone give me insight about this issue? Thanks.

clsmedia commented 11 months ago

Hi. New version of Codeigniter4 had changes in config. Some values were moved to separate config files. Check https://codeigniter.com/user_guide/installation/upgrade_440.html#config-files for more info.

cahyadsn commented 7 months ago

hi @hilmanmustofaa , you can update line 90 by this code:

$.ajaxSetup({headers:{'<?= config('Security')->headerName ?>':$('meta[name="<?= config('Security')->tokenName ?>"]').attr('content')}})