Clean up notifications

This commit is contained in:
James Cole
2024-12-14 07:13:01 +01:00
parent 8030167ffc
commit b3560ff525
31 changed files with 256 additions and 624 deletions

View File

@@ -127,10 +127,14 @@ class LoginController extends Controller
}
app('log')->warning('Login attempt failed.');
$username = (string) $request->get($this->username());
if (null === $this->repository->findByEmail($username)) {
$user = $this->repository->findByEmail($username);
if (null === $user) {
// send event to owner.
event(new UnknownUserAttemptedLogin($username));
}
if(null !== $user) {
event(new UserAttemptedLogin($user));
}
// Copied directly from AuthenticatesUsers, but with logging added:
// If the login attempt was unsuccessful we will increment the number of attempts