Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Feb 5, 2020
1 parent f206e26 commit 7ddac28
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/Auth/SessionGuard.php
Expand Up @@ -368,7 +368,7 @@ public function attempt(array $credentials = [], $remember = false)
// If the authentication attempt fails we will fire an event so that the user
// may be notified of any suspicious attempts to access their account from
// an unrecognized user. A developer may listen to this event as needed.
$this->fireFailedEvent($this->lastAttempted, $credentials);
$this->fireFailedEvent($user, $credentials);

return false;
}
Expand Down Expand Up @@ -630,7 +630,7 @@ protected function fireAttemptEvent(array $credentials, $remember = false)
}

/**
* Fires the retrieved event if the dispatcher is set.
* Fires the validated event if the dispatcher is set.
*
* @param $user
*/
Expand Down
3 changes: 3 additions & 0 deletions tests/Integration/Auth/AuthenticationTest.php
Expand Up @@ -119,15 +119,18 @@ public function testLoggingInFailsViaAttempt()
$this->assertFalse(
$this->app['auth']->attempt(['email' => 'wrong', 'password' => 'password'])
);

$this->assertFalse($this->app['auth']->check());
$this->assertNull($this->app['auth']->user());

Event::assertDispatched(Attempting::class, function ($event) {
$this->assertSame('web', $event->guard);
$this->assertEquals(['email' => 'wrong', 'password' => 'password'], $event->credentials);

return true;
});
Event::assertNotDispatched(Validated::class);

Event::assertDispatched(Failed::class, function ($event) {
$this->assertSame('web', $event->guard);
$this->assertEquals(['email' => 'wrong', 'password' => 'password'], $event->credentials);
Expand Down

0 comments on commit 7ddac28

Please sign in to comment.