inertia-laravel
inertia-laravel copied to clipboard
Fixing methods getting ignored after redirect
Subject
The inertia middleware ignores the methods comming from the vuejs to the laravel application, after they are redirected many times, they are all treated as GET methods.
How to reproduce
1- Fresh Laravel application with Jetstream installed.
2- If cPanel available, activated the automatic HTTP to HTTPS redirect.
3- Try activating the Two-Factor-Authentication via the Frontend.
Solution
Since the redirected method is actually ignored but is represented in the header REDIRECT_REDIRECT_REQUEST_METHOD as the redirect method, we can actually override the current method, with the redirect one if it's existing.
which we can find in $request->server('REDIRECT_REDIRECT_REQUEST_METHOD').
@reinink any updates ?
Heya. We removed our master branch. Feel free to re-attempt this to 1.x!