Skip to content

Conversation

@reinink
Copy link
Member

@reinink reinink commented Sep 17, 2020

This PR updates the service provider to register the Inertia middleware in the web middleware group, instead of the global middleware stack.

The primary motivation for this change is because the current session reflashing behaviour does not work right now, and that's because the middleware is run before the session is started. Moving it to the end of the web middleware group fixes this.

if ($request->hasSession()) {
$request->session()->reflash();
}

Also, it feels odd to register the Inertia middleware globally, when it should really only run on the web endpoints, and not, for example, on the api endpoints.

@reinink reinink merged commit 4f0e1ef into master Sep 17, 2020
@reinink reinink deleted the register-middleware-in-group branch September 17, 2020 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants