mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-17 00:51:04 +02:00
Set SettingService behind a Facade
This commit is contained in:
@ -7,6 +7,7 @@ use Carbon\Carbon;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use App\Facades\Settings;
|
||||
|
||||
class KickOutInactiveUser
|
||||
{
|
||||
@ -32,8 +33,7 @@ class KickOutInactiveUser
|
||||
$inactiveFor = $now->diffInSeconds(Carbon::parse($user->last_seen_at));
|
||||
|
||||
// Fetch all setting values
|
||||
$settingService = resolve('App\Services\SettingService');
|
||||
$kickUserAfterXSecond = intval($settingService->get('kickUserAfter')) * 60;
|
||||
$kickUserAfterXSecond = intval(Settings::get('kickUserAfter')) * 60;
|
||||
|
||||
// If user has been inactive longer than the allowed inactivity period
|
||||
if ($kickUserAfterXSecond > 0 && $inactiveFor > $kickUserAfterXSecond) {
|
||||
|
Reference in New Issue
Block a user