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

Usermodel #23

Closed
ghost opened this issue Dec 4, 2015 · 5 comments
Closed

Usermodel #23

ghost opened this issue Dec 4, 2015 · 5 comments

Comments

@ghost
Copy link

ghost commented Dec 4, 2015

I've followed this tuto : http://www.bravo-kernel.com/2015/04/how-to-add-jwt-authentication-to-a-cakephp-3-rest-api/

I tried to change the entity "Users" by "Logins". "Users" uses username and password for authentication, and "Logins" uses email and password as fields for authentication.
It's working with Users but not with Logins.
I can't find where's the issue. You can check the work I've done for this issue on this repo : https://github.com/Piclebeuh/cake3api.app

Thanks

@ADmad
Copy link
Owner

ADmad commented Dec 4, 2015

Since your Logins model uses email and password specify 'username' => 'emai' in your Form authenticate config.

@ADmad ADmad closed this as completed Dec 4, 2015
@ADmad
Copy link
Owner

ADmad commented Dec 4, 2015

For JwtAuth also use 'fields' => [ 'username' => 'id'] as shown in README. That tutorial is v1 of this plugin.

@bravo-kernel
Copy link
Contributor

I will update the tutorial this weekend, until then take a look at this already updated code https://github.com/bravo-kernel/application-examples/pull/1/files. It contains all the changes you need to make.

@ghost
Copy link
Author

ghost commented Dec 7, 2015

Thanks ! :)

@bravo-kernel
Copy link
Contributor

Tutorial is updated as well ☺️

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

No branches or pull requests

2 participants