Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AppController AuthComponent #5

Open
hassanfaizm opened this issue Apr 1, 2018 · 1 comment
Open

AppController AuthComponent #5

hassanfaizm opened this issue Apr 1, 2018 · 1 comment
Labels

Comments

@hassanfaizm
Copy link

In AppController
when i replace

$this->loadComponent('Auth', [
            'authorize' => 'Controller',
            'storage' => 'Session',
        ]);

to

$this->loadComponent('Auth', [
        'authenticate' => [
            'RememberMe.Cookie' => [
                'userModel' => 'Users',
                'fields' => ['username' => 'email'],
                'inputKey' => 'remember_me',
            ],
            // ... other authenticater config
        ],
        // ... other auth component config
    ]);

it fails to identify the user.

@nojimage
Copy link
Owner

nojimage commented Apr 2, 2018

In the setting after replacement, it may be a problem that the field used for authentication is email.

If you are using the Auth component in the first setting, you should do it as follows:

        $this->loadComponent('Auth', [
            'authenticate' => [
                'RememberMe.Cookie',
            ],
            'authorize' => 'Controller',
            'storage' => 'Session',
        ]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants