mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-02-16 10:29:16 +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
|
* @var \App\Models\User
|
||||||
*/
|
*/
|
||||||
$user = $event->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([
|
$log = $user->authentications()->create([
|
||||||
'ip_address' => $ip,
|
'ip_address' => $ip,
|
||||||
|
@ -43,8 +43,10 @@ public function handle(mixed $event) : void
|
|||||||
/**
|
/**
|
||||||
* @var \App\Models\User
|
* @var \App\Models\User
|
||||||
*/
|
*/
|
||||||
$user = $event->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();
|
||||||
$userAgent = $this->request->userAgent();
|
$userAgent = $this->request->userAgent();
|
||||||
$known = $user->authentications()
|
$known = $user->authentications()
|
||||||
->whereIpAddress($ip)
|
->whereIpAddress($ip)
|
||||||
|
@ -42,8 +42,10 @@ public function handle(mixed $event) : void
|
|||||||
/**
|
/**
|
||||||
* @var \App\Models\User
|
* @var \App\Models\User
|
||||||
*/
|
*/
|
||||||
$user = $event->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();
|
||||||
$userAgent = $this->request->userAgent();
|
$userAgent = $this->request->userAgent();
|
||||||
$log = $user->authentications()
|
$log = $user->authentications()
|
||||||
->whereIpAddress($ip)
|
->whereIpAddress($ip)
|
||||||
|
@ -48,8 +48,10 @@ public function handle(mixed $event) : void
|
|||||||
/**
|
/**
|
||||||
* @var \App\Models\User
|
* @var \App\Models\User
|
||||||
*/
|
*/
|
||||||
$user = $event->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();
|
||||||
$userAgent = $this->request->userAgent();
|
$userAgent = $this->request->userAgent();
|
||||||
$authLog = $user->authentications()
|
$authLog = $user->authentications()
|
||||||
->whereIpAddress($ip)
|
->whereIpAddress($ip)
|
||||||
|
@ -23,8 +23,10 @@ public function handle(mixed $event) : void
|
|||||||
/**
|
/**
|
||||||
* @var \App\Models\User
|
* @var \App\Models\User
|
||||||
*/
|
*/
|
||||||
$user = $event->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();
|
||||||
$userAgent = $this->request->userAgent();
|
$userAgent = $this->request->userAgent();
|
||||||
$guard = config('auth.defaults.guard');
|
$guard = config('auth.defaults.guard');
|
||||||
$known = $user->authentications()
|
$known = $user->authentications()
|
||||||
|
Loading…
Reference in New Issue
Block a user