Skip to content
This repository was archived by the owner on Jul 16, 2021. It is now read-only.

Bind web middleware on 404 / http exceptions - Stay logged in #413

Closed
garygreen opened this issue Feb 14, 2017 · 0 comments
Closed

Bind web middleware on 404 / http exceptions - Stay logged in #413

garygreen opened this issue Feb 14, 2017 · 0 comments

Comments

@garygreen
Copy link

At the moment, when a 404 (or any renderable exception) is thrown, because it hasn't matched a route the web middleware does not get bound, therefore you won't have a session etc.

This creates quite a jarring experience if you have layouts / views that switch the navigation based on if the user is logged in etc. It'll make it look like the user has logged out when it displays the 404 page.

You can get around this by moving your web middleware to the global middleware array - but this means that all that middleware get's run, even on api requests. It makes the whole middleware group a bit pointless.

As it's a renderable page, wouldn't make sense to bind the web middleware?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant