Closed adam-jones-net closed 3 years ago
Hi
You can achieve this by Extending Sentinel, more specifically, the User model.
Then on the extended User model, you need to add a protected $loginNames = ['email', 'enabled'];
property, which be default only contains the email
field.
Hope it helps.
Thanks so much @brunogaspar , that did the trick!
I have added an additional criteria to the authenticate() call in Sentinel as I have a column in my users table called 'enabled'. That needs to be set to 1 for a user to login. My authentication request to Sentinel is as follows:
if (Sentinel::authenticate(['username'=> $request->log, 'password' => $request->pwd, 'enabled' => 1],$rememberMe)){
however even for users where the record is set to 0, the authentication still passes. It seems that this enabled field is just ignored completely.
What am I doing wrong ?