diff options
author | Sam Light <samlight1994@gmail.com> | 2025-04-10 00:46:41 +0100 |
---|---|---|
committer | Sam Light <samlight1994@gmail.com> | 2025-04-10 00:46:41 +0100 |
commit | 237ca0698f63ea69ad0e93565f98a25d5aa81b59 (patch) | |
tree | 78ba5ce277ef2d40a180bad816948d3f0b69bea5 /src | |
parent | 35a5ec6c119c5acc8f25997187affd228d680ffb (diff) |
Handle events better
Diffstat (limited to 'src')
-rw-r--r-- | src/AuthSubscriber.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/AuthSubscriber.php b/src/AuthSubscriber.php index 6d4cc63..1827ae5 100644 --- a/src/AuthSubscriber.php +++ b/src/AuthSubscriber.php @@ -13,10 +13,11 @@ use Illuminate\Events\Dispatcher; class AuthSubscriber { - private function handleEvent(Status $status, mixed $event): void + private function handleEvent(Status $status, mixed $event, iterable $props): void { $log = new AuthLog([ 'status' => $status, + 'properties' => $props, ]); $log->user()->associate($event->user); $log->save(); @@ -29,7 +30,8 @@ class AuthSubscriber public function handleFailed(Failed $event): void { - $this->handleEvent(Status::LoginFailure, $event); + $creds = collect($event->credentials)->except('password'); + $this->handleEvent(Status::LoginFailure, $event, $creds); } public function handleLogout(Logout $event): void |