fuel / auth

Fuel PHP Framework - Fuel v1.x Authentication package
http://fuelphp.com/docs/packages/auth/intro.html
76 stars 57 forks source link

Login with username or email, not both #113

Closed Daijobou closed 8 years ago

Daijobou commented 8 years ago

Hi. In version 1.8 users can login with username or email. I want that user can only login with email and not with username. In https://github.com/fuel/auth/blob/1.9/develop/classes/auth/login/simpleauth.php#L132 I can edit this. Is this overwritten in next update with composer?

Can you add in config/simpleauth.php a setting that value of "username_post_key" is the only field for login?

WanWizard commented 8 years ago

Do not change framework code, it will indeed be overwritten.

Instead, if you want a different behaviour, extend the Simpleauth class, and add your own custom methods to it. You might also want to create a migration that adds an index on the email column to speed up lookups.

See http://bin.fuelphp.com/snippet/view/ND for info on how to do that.

Daijobou commented 8 years ago

Wow! Thank you very much for your great support. :)

👍