Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix mongoauth.php

  • Loading branch information...
commit 850129f95778d2540122839c0a53c8272c99159b 1 parent e301706
@julien-c julien-c authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 mongoauth.php
View
8 mongoauth.php
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.