php - create custom authenticate controller with different database filed in Laravel -
auth::attempt(['u_email'=>$credentials['email'],'u_password'=>sha1($credentials['password'])])
i'm use code authentication i'm getting undefined index: password
error can 1 create custom authentication control without changing in vendor library
thank in advance me...
there 3 things need do.
pass plain-text password auth::attempt() laravel hash before verifying against hash stored in database.
auth::attempt(['u_email'=>$credentials['email'],'password' => $credentials['password']]);
pass password password, not u_password auth::attempt(). key doesn't need match password column name (why? see point 3.), must equal password - see point 1 example.
implement getauthpassword() method in user model, return value of u_password column. method used user provider fetch password hash later verified against passed auth::attempt()
//in user.php public function getauthpassword() { return $this->u_password; }
Comments
Post a Comment