Miguel Nogueira
4eb115d165
This reverts pull request #6. > This pull request applies code style fixes from an analysis carried out by [StyleCI](https://bitbucket.styleci.io). > > For more information, click [here](https://bitbucket.styleci.io/analyses/a2Jl7D).
37 lines
795 B
PHP
37 lines
795 B
PHP
<?php
|
|
|
|
namespace App\Listeners;
|
|
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
use Illuminate\Support\Facades\Log;
|
|
|
|
class LogAuthenticationSuccess
|
|
{
|
|
/**
|
|
* Create the event listener.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct()
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Handle the event.
|
|
*
|
|
* @param object $event
|
|
* @return void
|
|
*/
|
|
public function handle($event)
|
|
{
|
|
Log::info('SECURITY (postauth-pre2fa): Detected successful login attempt', [
|
|
'accountID' => $event->user->id,
|
|
'sourceIP' => request()->ip(),
|
|
'matchesAccountLastIP' => request()->ip() == $event->user->originalIP,
|
|
'sourceUserAgent' => request()->userAgent(),
|
|
]);
|
|
}
|
|
}
|