From b354a352721c2394e4b68abf529c1a855e854af7 Mon Sep 17 00:00:00 2001 From: Matt Hollis Date: Fri, 7 Sep 2018 15:58:40 -0500 Subject: [PATCH 1/4] Update HttpKernel to use Authenticate middleware under App namespace The `Authenticate` middleware is intended to be called in a specific order before applying developer-listed middleware. In 5.7, it was changed to `App\Http\Middleware\Authenticate` but the priority still lists it as living under `Illuminate\Auth\Middleware\Authenticate`. This proposed fix moves that priority array to `App\Http\Kernel` and changes the reference to the userland class. --- app/Http/Kernel.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 0e5dff86..29320344 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -61,4 +61,20 @@ class Kernel extends HttpKernel 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, ]; + + /** + * The priority-sorted list of middleware. + * + * Forces the listed middleware to always be in the given order. + * + * @var array + */ + protected $middlewarePriority = [ + \Illuminate\Session\Middleware\StartSession::class, + \Illuminate\View\Middleware\ShareErrorsFromSession::class, + \App\Http\Middleware\Authenticate::class, + \Illuminate\Session\Middleware\AuthenticateSession::class, + \Illuminate\Routing\Middleware\SubstituteBindings::class, + \Illuminate\Auth\Middleware\Authorize::class, + ]; } From 0eb1a8f3bc8725edc036f8a71a62fb0a39adfb7b Mon Sep 17 00:00:00 2001 From: Matt Hollis Date: Fri, 7 Sep 2018 16:20:54 -0500 Subject: [PATCH 2/4] Update Kernel.php --- app/Http/Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 29320344..e65b1380 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -61,7 +61,7 @@ class Kernel extends HttpKernel 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, ]; - + /** * The priority-sorted list of middleware. * @@ -69,7 +69,7 @@ class Kernel extends HttpKernel * * @var array */ - protected $middlewarePriority = [ + protected $middlewarePriority = [ \Illuminate\Session\Middleware\StartSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class, \App\Http\Middleware\Authenticate::class, From 7f6ec77e6944a2a3b43b8c4362384cace6d79df2 Mon Sep 17 00:00:00 2001 From: Matt Hollis Date: Fri, 7 Sep 2018 16:22:40 -0500 Subject: [PATCH 3/4] Update Kernel.php StyleCI fixes --- app/Http/Kernel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index e65b1380..2026708f 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -69,7 +69,7 @@ class Kernel extends HttpKernel * * @var array */ - protected $middlewarePriority = [ + protected $middlewarePriority = [ \Illuminate\Session\Middleware\StartSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class, \App\Http\Middleware\Authenticate::class, From 04960ed8be1c86b46ded6628c64d73fc728e424d Mon Sep 17 00:00:00 2001 From: Matt Hollis Date: Fri, 7 Sep 2018 16:24:35 -0500 Subject: [PATCH 4/4] Update Kernel.php --- app/Http/Kernel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 2026708f..41ed672a 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -68,7 +68,7 @@ class Kernel extends HttpKernel * Forces the listed middleware to always be in the given order. * * @var array - */ + */ protected $middlewarePriority = [ \Illuminate\Session\Middleware\StartSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class,