leafsphp / auth

🔐 Leaf PHP auth module
https://leafphp.dev/modules/auth/
4 stars 5 forks source link

How to auth using email or another column #25

Open pwebdev opened 8 months ago

pwebdev commented 8 months ago

$login = auth()->login(['email' => $email, 'senha' => $pass]);

mychidarko commented 1 month ago

If senha is your password field, you can tell leaf to reference that in your auth config. If you use Leaf MVC or Leaf API, you can set this in config/auth.php:

'PASSWORD_KEY' => 'senha'

If you use just Leaf, you can call auth()->config() to update your config:

auth()->config('PASSWORD_KEY', 'passcode');

https://leafphp.dev/modules/auth/config.html#password-key