Merge pull request #858 from franzliedke/patch-14
[Auth] Eloquent driver does now allow login via object
This commit is contained in:
@@ -7,14 +7,20 @@ class Eloquent extends Driver {
|
|||||||
*
|
*
|
||||||
* If the user is a guest, null should be returned.
|
* If the user is a guest, null should be returned.
|
||||||
*
|
*
|
||||||
* @param int $id
|
* @param int|object $token
|
||||||
* @return mixed|null
|
* @return mixed|null
|
||||||
*/
|
*/
|
||||||
public function retrieve($id)
|
public function retrieve($token)
|
||||||
{
|
{
|
||||||
if (filter_var($id, FILTER_VALIDATE_INT) !== false)
|
// We return an object here either if the passed token is an integer (ID)
|
||||||
|
// or if we are passed a model object of the correct type
|
||||||
|
if (filter_var($token, FILTER_VALIDATE_INT) !== false)
|
||||||
{
|
{
|
||||||
return $this->model()->find($id);
|
return $this->model()->find($token);
|
||||||
|
}
|
||||||
|
else if (get_class($token) == Config::get('auth.model'))
|
||||||
|
{
|
||||||
|
return $token;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user