Open joereynolds opened 1 year ago
I believe $middlewarePriority
is not in the kernel by default.
You have to copy it from the base class.
After copying Laravel's $middlewarePriority
over (and doing a ./artisan route:cache
), it's still giving the same error unfortunately :(
diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php
index 9fb429db..494a7dd2 100644
--- a/app/Http/Kernel.php
+++ b/app/Http/Kernel.php
@@ -25,6 +25,20 @@ class Kernel extends HttpKernel
\App\Http\Middleware\FixNewRelicUnknownTransactionMiddleware::class,
];
+ protected $middlewarePriority = [
+ \Illuminate\Foundation\Http\Middleware\HandlePrecognitiveRequests::class,
+ \Illuminate\Cookie\Middleware\EncryptCookies::class,
+ \Illuminate\Session\Middleware\StartSession::class,
+ \CodeZero\StageFront\Middleware\RedirectIfStageFrontIsEnabled::class,
+ \Illuminate\View\Middleware\ShareErrorsFromSession::class,
+ \Illuminate\Contracts\Auth\Middleware\AuthenticatesRequests::class,
+ \Illuminate\Routing\Middleware\ThrottleRequests::class,
+ \Illuminate\Routing\Middleware\ThrottleRequestsWithRedis::class,
+ \Illuminate\Contracts\Session\Middleware\AuthenticatesSessions::class,
+ \Illuminate\Routing\Middleware\SubstituteBindings::class,
+ \Illuminate\Auth\Middleware\Authorize::class,
+ ];
+
/**
* The application's route middleware groups.
*
Can you track where it is redirecting to?
On success it should redirect to the "intended" route or "/". On error it should redirect back with errors as per default validation behavior.
Yes, so the login is at:
https://my-domain.local.test.io/myprefixed/path/stagefront/
And on either failure or success it goes to:
https://my-domain.local.test.io/myprefixed/path/stagefront/stagefront/
No validation errors come through. I'll try and debug further when I get the chance
Hello!
I saw issue #4 and I thought it might solve my problem but unfortunately it doesn't help.
The problem
After installing the project via composer, I then add the middleware:
(Note this is the only place to add it, there is no
$middlewarePriority
for Laravel 9 from what I can tell).After this, I add these
.env
valuesThe stagefront page loads successfully but any successful or unsuccessful logins get immediately redirected to a 404. I have cleared and populated the cache with
route:cache
and ran into the same problems.Thanks, and I hope you can help!