Welcome Guest, Not a member yet? Register   Sign In
Got error when install codeigniter shield
#1

i got this error when install codeigniter shield.
this is my version:
codeigniter4/framework            v4.2.11 The CodeIgniter framework v4
codeigniter4/settings              v2.2.0  Settings library for CodeIgniter 4
codeigniter4/shield                v1.1.0  Authentication and Authorization for CodeIgniter 4

Please Help

ErrorException
Undefined property: Config\Security::$csrfProtection

VENDORPATH\codeigniter4\shield\src\Authentication\Authenticators\Session.php at line 102

95      * Checks less secure Configuration.
96      */
97    private function checkSecurityConfig(): void
98    {
99        /** @var Security $securityConfig */
100        $securityConfig = config('Security');
101
102        if ($securityConfig->csrfProtection === 'cookie') {
103            throw new SecurityException(
104                'Config\Security::$csrfProtection is set to \'cookie\'.'
105                    . ' Same-site attackers may bypass the CSRF protection.'
106                    . ' Please set it to \'session\'.'
107            );
108        }
109    }
Reply
#2

You should upgrade to CodeIgniter 4.6.0 there were a lot of changes between those versions.

I'm running CI 4.6.0 php 8.4.3 and shield 1.1.0 with no problems so could be in the change logs.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

(01-29-2025, 12:20 AM)InsiteFX Wrote: You should upgrade to CodeIgniter 4.6.0 there were a lot of changes between those versions.

I'm running CI 4.6.0 php 8.4.3 and shield 1.1.0  with no problems so could be in the change logs.

Thankyou so much for your advice bro @InsiteFX
Reply




Theme © iAndrew 2016 - Forum software by © MyBB