mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-11-22 00:03:09 +01:00
Fix be745efc26
- Fixes #396
This commit is contained in:
parent
c45fb2f658
commit
70cd730a49
@ -45,7 +45,9 @@ public function handle(mixed $event) : void
|
||||
* @var \App\Models\User
|
||||
*/
|
||||
$user = $event->user;
|
||||
$ip = $this->request->header(config('2fauth.proxy_headers.forIp'), $this->request->ip());
|
||||
$ip = config('2fauth.proxy_headers.forIp')
|
||||
? $this->request->header(config('2fauth.proxy_headers.forIp'), $this->request->ip())
|
||||
: $this->request->ip();
|
||||
|
||||
$log = $user->authentications()->create([
|
||||
'ip_address' => $ip,
|
||||
|
@ -43,8 +43,10 @@ public function handle(mixed $event) : void
|
||||
/**
|
||||
* @var \App\Models\User
|
||||
*/
|
||||
$user = $event->user;
|
||||
$ip = $this->request->header(config('2fauth.proxy_headers.forIp'), $this->request->ip());
|
||||
$user = $event->user;
|
||||
$ip = config('2fauth.proxy_headers.forIp')
|
||||
? $this->request->header(config('2fauth.proxy_headers.forIp'), $this->request->ip())
|
||||
: $this->request->ip();
|
||||
$userAgent = $this->request->userAgent();
|
||||
$known = $user->authentications()
|
||||
->whereIpAddress($ip)
|
||||
|
@ -42,8 +42,10 @@ public function handle(mixed $event) : void
|
||||
/**
|
||||
* @var \App\Models\User
|
||||
*/
|
||||
$user = $event->user;
|
||||
$ip = $this->request->header(config('2fauth.proxy_headers.forIp'), $this->request->ip());
|
||||
$user = $event->user;
|
||||
$ip = config('2fauth.proxy_headers.forIp')
|
||||
? $this->request->header(config('2fauth.proxy_headers.forIp'), $this->request->ip())
|
||||
: $this->request->ip();
|
||||
$userAgent = $this->request->userAgent();
|
||||
$log = $user->authentications()
|
||||
->whereIpAddress($ip)
|
||||
|
@ -48,8 +48,10 @@ public function handle(mixed $event) : void
|
||||
/**
|
||||
* @var \App\Models\User
|
||||
*/
|
||||
$user = $event->user;
|
||||
$ip = $this->request->header(config('2fauth.proxy_headers.forIp'), $this->request->ip());
|
||||
$user = $event->user;
|
||||
$ip = config('2fauth.proxy_headers.forIp')
|
||||
? $this->request->header(config('2fauth.proxy_headers.forIp'), $this->request->ip())
|
||||
: $this->request->ip();
|
||||
$userAgent = $this->request->userAgent();
|
||||
$authLog = $user->authentications()
|
||||
->whereIpAddress($ip)
|
||||
|
@ -23,8 +23,10 @@ public function handle(mixed $event) : void
|
||||
/**
|
||||
* @var \App\Models\User
|
||||
*/
|
||||
$user = $event->user;
|
||||
$ip = $this->request->header(config('2fauth.proxy_headers.forIp'), $this->request->ip());
|
||||
$user = $event->user;
|
||||
$ip = config('2fauth.proxy_headers.forIp')
|
||||
? $this->request->header(config('2fauth.proxy_headers.forIp'), $this->request->ip())
|
||||
: $this->request->ip();
|
||||
$userAgent = $this->request->userAgent();
|
||||
$guard = config('auth.defaults.guard');
|
||||
$known = $user->authentications()
|
||||
|
Loading…
Reference in New Issue
Block a user