diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 0a46f85..3e0a921 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -5,6 +5,7 @@ namespace App\Providers; use Illuminate\Pagination\Paginator; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\App; +use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\URL; use Illuminate\Support\ServiceProvider; @@ -17,6 +18,12 @@ class AppServiceProvider extends ServiceProvider */ public function boot() { + if ( + in_array(config('app.env'), ['local', 'testing']) && config('app.bypassldap') && !app()->runningInConsole() + ) { + Auth::loginUsingId(1); + } + // !!! Fuc**** Lab LDC exception OMG !!! if (!in_array(config('app.env'), ['local', 'testing'])) { URL::forceRootUrl(config('app.url')); @@ -26,11 +33,10 @@ class AppServiceProvider extends ServiceProvider return $url->current(); }); } - // * LOCAL HTTPS FIX - if (!in_array(config('app.env'), ['local', 'testing'])) { - URL::forceScheme('https'); - } - // * HA PROXY FIX + // * Force HTTPS + URL::forceScheme('https'); + + // * REVERSE PROXY FIX App::singleton('clientIp', function () { if (config('app.env') == 'local') { return request()->getClientIp(); diff --git a/config/app.php b/config/app.php index d1b9bc4..93d200d 100644 --- a/config/app.php +++ b/config/app.php @@ -4,6 +4,8 @@ use Illuminate\Support\Facades\Facade; return [ + 'bypassldap' => env('BYPASS_LDAP', false), + /* |-------------------------------------------------------------------------- | Application Name