CakeDC/users

Looping on CakePHP 4

Closed this issue · 4 comments

rkhe commented

Encountering a loading loop on a fresh install of CakePHP 4 with CakeDC/Users.
No other configuration for CakeDC/Users except adding $this->addPlugin(\CakeDC\Users\Plugin::class); in Application.php

Loading loop on those 3 files, cake.css, normalize.min.css & milligram.min.css (from terminal):

[Tue Aug 25 19:55:13 2020] ::1:64084 [200]: /css/cake.css
[Tue Aug 25 19:55:13 2020] ::1:64087 [200]: /css/normalize.min.css
[Tue Aug 25 19:55:13 2020] ::1:64088 [200]: /css/milligram.min.css
[Tue Aug 25 19:55:13 2020] ::1:64089 [200]: /css/cake.css
[Tue Aug 25 19:55:13 2020] ::1:64092 [200]: /css/normalize.min.css
[Tue Aug 25 19:55:13 2020] ::1:64093 [200]: /css/milligram.min.css
[Tue Aug 25 19:55:13 2020] ::1:64094 [200]: /css/cake.css

Other notes:

  • It seems only reproducible on Chromium-based browser, tested on Google Chrome, Edge(Chromium) & Brave but not on Firefox.
  • CakePHP 4.0.1, CakeDC/Users 9.0
rkhe commented

Found a workaround.

Copy the permissions.php file from /vendor/cakedc/users/config to /config directory.
However, this should already use the permission configuration from /vendor directory and run out of the box, right?

Please check the logs, access log of your webserver, what's the URI looping around?

The default configuration of the plugin will redirect to /users/login which is a page NOT requiring authentication to display.

I am experiencing the same issue and copying the permissions.php as suggested above by @rkhe has temporarily resolved the issue, although this is not ideal. What is the root cause of this issue?

I am wondering if it has something to do with the BootstrapUI plugin installed. To reproduce, create a new CakePHP 4 application and issue the following:

  • Configure config/app_local.php and setup database connection
  • composer require cakedc/users
  • bin/cake migrations migrate -p CakeDC/Users

src/Application.php:

        $this->addPlugin(\CakeDC\Users\Plugin::class);
        // Uncomment the line below to load your custom users.php config file
        //Configure::write('Users.config', ['users']);
  • bin/cake users addSuperuser

src/View/AppView.php:

        $this->loadHelper('CakeDC/Users.User');
  • composer require friendsofcake/bootstrap-ui
  • bin/cake plugin load BootstrapUI
  • bin/cake bootstrap install
  • bin/cake bootstrap modify_view
  • bin/cake bootstrap copy_layouts

This seems to be related and has a solution: #871

Another related issue for DebugKit: #870

It seems this is actually a documentation issue in the "Installation" guide for the Users plugin.