From b354a352721c2394e4b68abf529c1a855e854af7 Mon Sep 17 00:00:00 2001 From: Matt Hollis Date: Fri, 7 Sep 2018 15:58:40 -0500 Subject: [PATCH] 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, + ]; }