mirror of
https://github.com/henrywhitaker3/Speedtest-Tracker.git
synced 2025-12-21 13:23:04 +01:00
Added optional authentication
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Helpers\BackupHelper;
|
||||
use App\Helpers\SettingsHelper;
|
||||
use DateTime;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
@@ -12,6 +13,13 @@ use Illuminate\Http\JsonResponse;
|
||||
class BackupController extends Controller
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
if((bool)SettingsHelper::get('auth')->value === true) {
|
||||
$this->middleware('auth:api');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get backup of speedtests
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user