Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CakePHP Auth Manual login

Tags:

cakephp

I am interested in testing the incoming password field for a particular admin level password. If it matches, I want it to manually have Auth log in with whatever username they want (submitted via form)

My understanding is Auth, in taking the data, will only authorize it if it sees the same email/hashed password in the database. Is there a way to get around this check to manually set it? Even $this->Auth->login(..) will do this check right?

like image 484
pll Avatar asked Nov 23 '25 14:11

pll


1 Answers

$this->Auth->login($userId)

Auth::login accepts either a username/password combination or simply a user id (the primary key of the user model in the database).

like image 86
deceze Avatar answered Nov 25 '25 10:11

deceze



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!