Xety / Cake3-CookieAuth

A simple Cake 3 plugin to automatically authenticate users with Cookies.
http://xeta.io
MIT License
18 stars 13 forks source link

Specify authentication fields in the documentation #6

Closed ToX82 closed 8 years ago

ToX82 commented 8 years ago

I have an application using email and password for authentication, and I've had a few problems trying to integrate Cake3-CookieAuth. After some investigation, I have found out that you need to tell CookieAuth which fields are in use:

$this->loadComponent('Auth', [
    'authenticate' => [
        'Form' => [
            'fields' => ['username' => 'email']
        ],
        'Xety/Cake3CookieAuth.Cookie' => [
            'fields' => ['username' => 'email'] // this is what I was missing
        ]
    ],
    ...
]);

I think that this should be explained in the README...

Moutard3 commented 8 years ago

👍 Was missing the same thing

Xety commented 8 years ago

Sorry for the late reply. The fields name are the default one used by CakePHP itself. But i will add it to the Readme.

PhantomWatson commented 7 years ago

This doesn't appear to have been added to the readme.

Xety commented 7 years ago

@PhantomWatson I added it in this commit : https://github.com/Xety/Cake3-CookieAuth/commit/b1f899eba842e43584caee2c873ec852bfa180fa#diff-04c6e90faac2675aa89e2176d2eec7d8R31. You can find it in the Configuration part : https://github.com/Xety/Cake3-CookieAuth#configuration

I don't want to set all the configuration options in the Readme, due to the change that Cake can do. So i prefer to redirect people to the officiel Cake doc.

PhantomWatson commented 7 years ago

Ohhh, I understand now. Thanks!