Skip to content

Commit f4ad854

Browse files
authored
handle case where the login fails because the user doesn't exist
1 parent 5449d64 commit f4ad854

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/AuthNotifications.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ public function handleFailed(Failed $event): void
3838
if (! in_array($event->guard, config('auth-notifications.listen_to.login_failed.guards'))) {
3939
return;
4040
}
41+
42+
if (empty($event->user)) {
43+
return;
44+
}
4145

4246
$event->user->notify(new LoginFailed($event, request()));
4347
}

0 commit comments

Comments
 (0)