我正在使用CakeDC用户插件进行身份验证。我已经按照文档中的这里执行了所有安装步骤,但是我得到了以下错误:

我执行了以下步骤:
composer require cakedc/userscomposer require league/oauth2-facebook:@stablecomposer require league/oauth2-google:@stablebin/cake migrations migrate -p CakeDC/Users Configure::write('Users.config', ['users']);
Plugin::load('CakeDC/Users', ['routes' => true, 'bootstrap' => true ]);
Configure::write('Users.Social.login', true); //to enable social login更新:我删除的
Configure::write('Users.config', ['users']);这一行来自我的引导程序,因为我使用的是默认的users.php文件,它现在出现在插件中。但我现在明白了这个错误:
Invalid provider or missing class (League\OAuth2\Client\Provider\LinkedIn)我可以通过禁用社交登录(这不是我想要做的)来消除这个错误:
Configure::write('Users.Social.login', false);禁用社交登录后,我会得到以下错误:
Error: A route matching "array ( 'plugin' => 'CakeDC/Users', 'controller' => 'Users', 'action' => 'login', 'prefix' => false, '_ext' => NULL, )" could not be found.任何帮助都能挽救我的日子。
发布于 2016-11-11 15:42:03
@ndm是正确的,步骤5用于配置,当安装composer删除以下2行时,修复迁移步骤之前的错误:
Configure::write('Users.config', ['users']);
Plugin::load('CakeDC/Users', ['routes' => true, 'bootstrap' => true ]);然后,在迁移之后,将这些行添加回以继续安装。
发布于 2016-06-03 10:13:21
第5步是定制-检查您已经链接的文档中的标头。因此,这实际上不是必需的安装步骤。
这个问题应该很容易从命名、遇到的错误和堆栈跟踪(只需检查每个框架中正在执行的操作)中找出--设置Users.config将用于定义自定义配置文件,而您定义的配置文件不存在(或不可移植),因此出现了错误。
collection((array)Configure::read('Users.config'))->each(function ($file) {配置::load($file);};
https://github.com/CakeDC/users/blob/3.2.0/config/bootstrap.php#L21-L23
所以,要么不要这样做,在其他地方(在您的app配置中或其他地方)定义配置,要么创建缺少的users.php配置文件并将您的用户插件配置放在其中。
另请参阅
https://github.com/CakeDC/users/.../Configuration.md#overriding-the-default-configuration
https://stackoverflow.com/questions/37610436
复制相似问题