mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-06-25 06:24:07 +02:00
Fix be745efc2668d4129244e5f4f79ac5189b774288 - Fixes #396
This commit is contained in:
parent
c45fb2f658
commit
70cd730a49
@ -45,7 +45,9 @@ class FailedLoginListener extends AbstractAccessListener
|
|||||||
* @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,
|
||||||
|
@ -44,7 +44,9 @@ class LoginListener extends AbstractAccessListener
|
|||||||
* @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)
|
||||||
|
@ -43,7 +43,9 @@ class LogoutListener extends AbstractAccessListener
|
|||||||
* @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)
|
||||||
|
@ -49,7 +49,9 @@ class OtherDeviceLogoutListener extends AbstractAccessListener
|
|||||||
* @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)
|
||||||
|
@ -24,7 +24,9 @@ class VisitedByProxyUserListener extends AbstractAccessListener
|
|||||||
* @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…
x
Reference in New Issue
Block a user