Added optional authentication

This commit is contained in:
Henry Whitaker
2020-08-21 17:31:43 +01:00
parent cd87a902a7
commit e10b4dccde
31 changed files with 149588 additions and 107 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Http\Controllers;
use App\Helpers\SettingsHelper;
use Exception;
use Updater;
use Illuminate\Http\Request;
@@ -9,6 +10,12 @@ use Illuminate\Http\JsonResponse;
class UpdateController extends Controller
{
public function __construct()
{
if((bool)SettingsHelper::get('auth')->value === true) {
$this->middleware('auth:api');
}
}
/**
* Check for new update