Permalink
Browse files

Fix mongoauth.php

  • Loading branch information...
1 parent e301706 commit 850129f95778d2540122839c0a53c8272c99159b @julien-c julien-c committed Oct 15, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 mongoauth.php
View
@@ -12,7 +12,11 @@ class MongoAuth extends \Laravel\Auth\Drivers\Driver {
*/
public function retrieve($id)
{
- return $this->model()->where("_id", $id)->first();
+ if (!$id) {
+ return NULL;
+ }
+
+ return $this->model()->where("_id", new \MongoId($id))->first();
}
/**
@@ -25,7 +29,7 @@ public function attempt($arguments = array())
{
$username = Config::get('auth.username');
- $user = $this->model()->where($username, $arguments['username'])->first();
+ $user = $this->model()->where($username, $arguments[$username])->first();
// This driver uses a basic username and password authentication scheme
// so if the credentials match what is in the database we will just

0 comments on commit 850129f

Please sign in to comment.