Skip to content

Commit

Permalink
Merge pull request #219 from AfzalivE/master
Browse files Browse the repository at this point in the history
Check for empty identity_columns after array_diff. Thanks @AfzalivE
  • Loading branch information
andrew13 committed Feb 8, 2014
2 parents 3c74dbd + f145dee commit 4fd06db
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Zizaco/Confide/Confide.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ public function logAttempt( $credentials, $confirmed_only = false, $identity_col
array_keys($credentials),
array('password','remember')
);
// Recheck if identity_columns are populated now
if (empty($identity_columns)) {
return false;
}
}

// Check for throttle limit then log-in
Expand Down
7 changes: 7 additions & 0 deletions tests/ConfideTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ public function testShouldLogAttempt()
$this->assertTrue(
$this->confide->logAttempt( $credentials, true )
);

unset($credentials['username']);
unset($credentials['email']);
// Should not login because there is no username or email provided
$this->assertFalse(
$this->confide->logAttempt( $credentials, true )
);
}

public function testShouldThrottleLogAttempt()
Expand Down

0 comments on commit 4fd06db

Please sign in to comment.