Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugbar assets path is set as previous url in the session causing resource validation redirect to break. #1622

Open
dhampik opened this issue May 22, 2024 · 0 comments

Comments

@dhampik
Copy link

dhampik commented May 22, 2024

The problem and a workaround are described in this laracasts thread 8 years ago. This is still the case.

In short, this is what's happening:

  1. User opens create route of any resource. StartSession middleware sets previous url on the session to this page.
  2. Debugbar is rendered on the page and tries to load its assets, which are loaded through AssetController in debugbar. That causes previous url on the session to be replaced with debugbar assets path.
  3. User submits the form, triggering a request to store route of the resource. Let's assume there is a validation going on and it produces a validation error.
  4. Laravel handles the validation error and by default redirects the user to the previous url from the session. Which is usually the create route, however when debugbar is enabled, it is replaced with assets path resulting in an unexpected redirect to the latter.

It would be great if debugbar urls were somehow excluded from being set as previous url on the session. Not sure how to achieve that, though, maybe use ->withoutMiddleware('StartSession') for such routes?

Either way, I think this problem deserves to be documented, at least in the form of this issue, because it was rather puzzling to see such behaviour when debugbar is enabled.

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

No branches or pull requests

1 participant