Register SSO middleware if enabled in configuration

This commit is contained in:
bpatath
2020-05-21 20:20:46 +02:00
parent 1eda806c17
commit 7b1380366b
3 changed files with 12 additions and 0 deletions

View File

@@ -26,6 +26,7 @@ use Illuminate\Support\Facades\Schema;
use Illuminate\Support\ServiceProvider;
use Laravel\Passport\Passport;
use URL;
use Adldap\Laravel\Middleware\WindowsAuthenticate;
/**
* @codeCoverageIgnore
@@ -44,6 +45,9 @@ class AppServiceProvider extends ServiceProvider
if ('heroku' === config('app.env')) {
URL::forceScheme('https');
}
if (config('ldap_auth.identifiers.windows.enabled', false)) {
$this->app['router']->pushMiddlewareToGroup('web', WindowsAuthenticate::class);
}
}
/**