mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-11-22 00:03:09 +01:00
Fix ip forwarded by proxy not being logged correctly - Closes #396
This commit is contained in:
parent
bc96815deb
commit
be745efc26
@ -45,7 +45,7 @@ public function handle(mixed $event) : void
|
||||
* @var \App\Models\User
|
||||
*/
|
||||
$user = $event->user;
|
||||
$ip = config('2fauth.proxy_headers.forIp') ?? $this->request->ip();
|
||||
$ip = $this->request->header(config('2fauth.proxy_headers.forIp'), $this->request->ip());
|
||||
|
||||
$log = $user->authentications()->create([
|
||||
'ip_address' => $ip,
|
||||
|
@ -44,7 +44,7 @@ public function handle(mixed $event) : void
|
||||
* @var \App\Models\User
|
||||
*/
|
||||
$user = $event->user;
|
||||
$ip = config('2fauth.proxy_headers.forIp') ?? $this->request->ip();
|
||||
$ip = $this->request->header(config('2fauth.proxy_headers.forIp'), $this->request->ip());
|
||||
$userAgent = $this->request->userAgent();
|
||||
$known = $user->authentications()
|
||||
->whereIpAddress($ip)
|
||||
|
@ -43,7 +43,7 @@ public function handle(mixed $event) : void
|
||||
* @var \App\Models\User
|
||||
*/
|
||||
$user = $event->user;
|
||||
$ip = config('2fauth.proxy_headers.forIp') ?? $this->request->ip();
|
||||
$ip = $this->request->header(config('2fauth.proxy_headers.forIp'), $this->request->ip());
|
||||
$userAgent = $this->request->userAgent();
|
||||
$log = $user->authentications()
|
||||
->whereIpAddress($ip)
|
||||
|
@ -49,7 +49,7 @@ public function handle(mixed $event) : void
|
||||
* @var \App\Models\User
|
||||
*/
|
||||
$user = $event->user;
|
||||
$ip = config('2fauth.proxy_headers.forIp') ?? $this->request->ip();
|
||||
$ip = $this->request->header(config('2fauth.proxy_headers.forIp'), $this->request->ip());
|
||||
$userAgent = $this->request->userAgent();
|
||||
$authLog = $user->authentications()
|
||||
->whereIpAddress($ip)
|
||||
|
@ -24,7 +24,7 @@ public function handle(mixed $event) : void
|
||||
* @var \App\Models\User
|
||||
*/
|
||||
$user = $event->user;
|
||||
$ip = config('2fauth.proxy_headers.forIp') ?? $this->request->ip();
|
||||
$ip = $this->request->header(config('2fauth.proxy_headers.forIp'), $this->request->ip());
|
||||
$userAgent = $this->request->userAgent();
|
||||
$guard = config('auth.defaults.guard');
|
||||
$known = $user->authentications()
|
||||
|
Loading…
Reference in New Issue
Block a user