Allow password field to be configured.
Signed-off-by: Colin Viebrock <colin@viebrock.ca>
This commit is contained in:
parent
8edd8fcbec
commit
62afdf3f2c
|
@ -31,6 +31,19 @@
|
||||||
|
|
||||||
'username' => 'email',
|
'username' => 'email',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Authentication Password
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may specify the database column that should be considered the
|
||||||
|
| "password" for your users. Typically, this will be "password" but, again
|
||||||
|
| you're free to change the value to anything.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'password' => 'password',
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Authentication Model
|
| Authentication Model
|
||||||
|
|
|
@ -35,7 +35,9 @@ public function attempt($arguments = array())
|
||||||
// log the user into the application and remember them if asked.
|
// log the user into the application and remember them if asked.
|
||||||
$password = $arguments['password'];
|
$password = $arguments['password'];
|
||||||
|
|
||||||
if ( ! is_null($user) and Hash::check($password, $user->password))
|
$password_field = Config::get('auth.password');
|
||||||
|
|
||||||
|
if ( ! is_null($user) and Hash::check($password, $user->get_attribute($password_field)))
|
||||||
{
|
{
|
||||||
return $this->login($user->id, array_get($arguments, 'remember'));
|
return $this->login($user->id, array_get($arguments, 'remember'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,11 +33,13 @@ public function attempt($arguments = array())
|
||||||
$user = $this->get_user($arguments['username']);
|
$user = $this->get_user($arguments['username']);
|
||||||
|
|
||||||
// This driver uses a basic username and password authentication scheme
|
// This driver uses a basic username and password authentication scheme
|
||||||
// so if the credentials mmatch what is in the database we will just
|
// so if the credentials match what is in the database we will just
|
||||||
// log the user into the application and remember them if asked.
|
// log the user into the application and remember them if asked.
|
||||||
$password = $arguments['password'];
|
$password = $arguments['password'];
|
||||||
|
|
||||||
if ( ! is_null($user) and Hash::check($password, $user->password))
|
$password_field = Config::get('auth.password');
|
||||||
|
|
||||||
|
if ( ! is_null($user) and Hash::check($password, $user->get_attribute($password_field)))
|
||||||
{
|
{
|
||||||
return $this->login($user->id, array_get($arguments, 'remember'));
|
return $this->login($user->id, array_get($arguments, 'remember'));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue