cakephp 3缺少路线

时间:2016-08-27 10:06:35

标签: cakephp routing

我有社交登录插件,hybridauth的cakephp 3应用程序。 有时工作登录面对谷歌,但有时我得到这样的错误:

enter image description here

' hybridauth'说明有线: 注意:为AuthComponent指定loginRedirect URL时,请务必添加'插件' => false(或适当的插件名称)到URL数组。

我的appcontroller可能是我做错了。它看起来像:

$this->loadComponent('Auth', [
        'authenticate' => [
            'Form' => [
                'fields' => [
                    'username' => 'email',
                    'password' => 'password'
                ]
            ],
    'ADmad/HybridAuth.HybridAuth' => [
        // All keys shown below are defaults
        'fields' => [
            'provider' => 'provider',
            'openid_identifier' => 'openid_identifier',
            'email' => 'email'
        ],
        'profileModel' => 'ADmad/HybridAuth.SocialProfiles',
        'profileModelFkField' => 'user_id',

        // The URL Hybridauth lib should redirect to after authentication.
        // If no value is specified you are redirect to this plugin's
        // HybridAuthController::authenticated() which handles persisting
        // user info to AuthComponent and redirection.
        'hauth_return_to' => null
    ]
        ],
        'loginRedirect' => [
            'controller' => 'Users',
            'action' => 'index',
            'ADmad/HybridAuth.HybridAuth' => 'false'
            'plugin' => 'false'
        ],
        'logoutRedirect' => [
            'controller' => 'Users',
            'action' => 'login',
            'home'
        ]
    ]);

就像你可以看到我尝试将广告行添加到主要' loginRedirect'但是又出现了同样的问题。

'ADmad/HybridAuth.HybridAuth' => 'false'
'plugin' => 'false'
请问有什么想法吗? 谢谢。

即使我有时也可以登录。随机。 每当我推脸或谷歌登录时,我都会得到session-Auth。我通过身份验证,但路由将我带到错误屏幕。 而且我可以将url更改为localhost / projectname / users / index,一切正常,有效。 我还尝试将路由添加到routes.php:

$routes->connect('/Users/index', ['controller' => 'Users', 'action' => 'index']);
$routes->connect('/http://localhost/sebastus1/hybrid-auth/authenticated', ['controller' => 'Users', 'action' => 'index']);

感谢ndm。 (字符串)'假' !=(布尔值)false

0 个答案:

没有答案