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.

  1. pass plain-text password auth::attempt() laravel hash before verifying against hash stored in database.

    auth::attempt(['u_email'=>$credentials['email'],'password' => $credentials['password']]); 
  2. 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.

  3. 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

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

Nuget pack csproj using nuspec -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -