From 29fcca26f88b2b16584da5f37b6a5c9ba2ac1f31 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 28 Jun 2020 13:47:13 +1000 Subject: [PATCH] Nest HTTP requirements inside a working installation - allows non secure routes to be used to setup the application --- app/Http/Controllers/BaseController.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/BaseController.php b/app/Http/Controllers/BaseController.php index 0a046e4f812d..5e90ad1ed17a 100644 --- a/app/Http/Controllers/BaseController.php +++ b/app/Http/Controllers/BaseController.php @@ -316,12 +316,13 @@ class BaseController extends Controller public function flutterRoute() { - - if (config('ninja.require_https') && !request()->isSecure()) { - return redirect()->secure(request()->getRequestUri()); - } - + if ((bool)$this->checkAppSetup() !== false && Schema::hasTable('accounts') && $account = Account::all()->first()) { + + if (config('ninja.require_https') && !request()->isSecure()) { + return redirect()->secure(request()->getRequestUri()); + } + $data = []; if (Ninja::isSelfHost()) {