Commit ff525b99 authored by Jeffrey Way's avatar Jeffrey Way

Add "remember" to ignore list

Signed-off-by: 's avatarJeffrey Way <jeffrey@envato.com>
parent 9dd964c3
...@@ -26,27 +26,28 @@ class Eloquent extends Driver { ...@@ -26,27 +26,28 @@ class Eloquent extends Driver {
*/ */
public function attempt($arguments = array()) public function attempt($arguments = array())
{ {
$user = $this->model()->where(function($query) use($arguments) { $user = $this->model()->where(function($query) use($arguments)
{
$username = Config::get('auth.username'); $username = Config::get('auth.username');
$query->where($username, '=', $arguments['username']); $query->where($username, '=', $arguments['username']);
foreach( array_except($arguments, array('username', 'password')) as $column => $val ) foreach(array_except($arguments, array('username', 'password', 'remember')) as $column => $val)
{ {
$query->where($column, '=', $val); $query->where($column, '=', $val);
} }
})->first(); })->first();
// If the credentials match what is in the database we will just // 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'];
$password_field = Config::get('auth.password', 'password'); $password_field = Config::get('auth.password', 'password');
if ( ! is_null($user) and Hash::check($password, $user->get_attribute($password_field))) 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'));
} }
return false; return false;
} }
......
...@@ -56,12 +56,13 @@ class Fluent extends Driver { ...@@ -56,12 +56,13 @@ class Fluent extends Driver {
{ {
$table = Config::get('auth.table'); $table = Config::get('auth.table');
return DB::table($table)->where(function($query) use($arguments) { return DB::table($table)->where(function($query) use($arguments)
{
$username = Config::get('auth.username'); $username = Config::get('auth.username');
$query->where($username, '=', $arguments['username']); $query->where($username, '=', $arguments['username']);
foreach( array_except($arguments, array('username', 'password')) as $column => $val ) foreach(array_except($arguments, array('username', 'password', 'remember')) as $column => $val)
{ {
$query->where($column, '=', $val); $query->where($column, '=', $val);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment