Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
rappasoft committed Nov 22, 2021
1 parent 5e9d771 commit c3e15a9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/Listeners/FailedLoginListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ public function __construct(Request $request)
$this->request = $request;
}

public function handle(Failed $event): void
public function handle($event): void
{
if (! $event instanceof (config('authentication-log.events.failed') ?? Failed::class)) {
return;
}

if ($event->user) {
$log = $event->user->authentications()->create([
'ip_address' => $ip = $this->request->ip(),
Expand Down
6 changes: 5 additions & 1 deletion src/Listeners/LogoutListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ public function __construct(Request $request)
$this->request = $request;
}

public function handle(Logout $event): void
public function handle($event): void
{
if (! $event instanceof (config('authentication-log.events.logout') ?? Logout::class)) {
return;
}

if ($event->user) {
$user = $event->user;
$ip = $this->request->ip();
Expand Down
6 changes: 5 additions & 1 deletion src/Listeners/OtherDeviceLogoutListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ public function __construct(Request $request)
$this->request = $request;
}

public function handle(OtherDeviceLogout $event): void
public function handle($event): void
{
if (! $event instanceof (config('authentication-log.events.other-device-logout') ?? OtherDeviceLogout::class)) {
return;
}

if ($event->user) {
$user = $event->user;
$ip = $this->request->ip();
Expand Down

0 comments on commit c3e15a9

Please sign in to comment.