File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55namespace Vdlp \BasicAuthentication ;
66
77use Backend \Helpers \Backend as BackendHelper ;
8+ use Illuminate \Routing \Router ;
89use October \Rain \Foundation \Application ;
9- use October \Rain \Foundation \Http \Kernel ;
1010use System \Classes \PluginBase ;
1111use Vdlp \BasicAuthentication \Console \CreateCredentialsCommand ;
1212use Vdlp \BasicAuthentication \Http \Middleware \BasicAuthenticationMiddleware ;
@@ -40,14 +40,13 @@ public function boot(): void
4040 (bool ) config ('basicauthentication.enabled ' , false ) === false
4141 || $ application ->runningInConsole ()
4242 || $ application ->runningUnitTests ()
43- || $ application ->runningInBackend ()
4443 ) {
4544 return ;
4645 }
4746
48- /** @var Kernel $kernel */
49- $ kernel = $ application[ ' Illuminate\Contracts\Http\Kernel ' ] ;
50- $ kernel -> prependMiddleware ( BasicAuthenticationMiddleware::class);
47+ /** @var Router $router */
48+ $ router = $ application-> make (Router::class) ;
49+ $ router -> pushMiddlewareToGroup ( ' web ' , BasicAuthenticationMiddleware::class);
5150 }
5251
5352 public function registerPermissions (): array
You can’t perform that action at this time.
0 commit comments