CakeDC / users

Users Plugin for CakePHP
https://www.cakedc.com
Other
519 stars 294 forks source link

CakeDC/users 12 in cakephp 5.x doesn't change the users.php file to /config.users.php and gives me Html error ERR_TOO_MANY_REDIRECTS #1063

Open mdeanquin0520 opened 5 months ago

mdeanquin0520 commented 5 months ago

I created a project with cakephp 5.x and added CakeDC/users plugin, when I enter the site it doesn't even show me the login page, it directly gives me the ERR_TOO_MANY_REDIRECTS error page and for some reason it doesn't change the /vendor/cakedc/users/config/users.php to /config/users.php, I am using it in my local computer with wampserver in Windows 10. This is the code for bootstrap method in Application.php:

    public function bootstrap(): void
    {
        // Call parent to load bootstrap from files.
        parent::bootstrap();

        if (PHP_SAPI !== 'cli') {
            FactoryLocator::add(
                'Table',
                (new TableLocator())->allowFallbackClass(false)
            );
        }

        /*
         * Only try to load DebugKit in development mode
         * Debug Kit should not be installed on a production system
         */
        if (Configure::read('debug')) {
            $this->addPlugin('DebugKit', ['bootstrap' => true]);
        }

        $this->addPlugin(\CakeDC\Users\Plugin::class);
        Configure::write('Users.config', ['users']);
    }

And what I only changed in users.php is the table and controller attributes to MyUsers, the RememberMe active and checked attributes to false, the Auth.AuthenticationComponent.loginRedirect to /home, and put in routes.php the / route to controller MyUsers and action login. How can I solve this issue?

rochamarcelo commented 5 months ago

Make to create permissions file and allow access to your custom controller, see https://github.com/CakeDC/users/blob/11.next-cake4/config/permissions.php

rochamarcelo commented 5 months ago

@mdeanquin0520 ^

ajibarra commented 2 weeks ago

@mdeanquin0520 can we close the issue?