Skip to content

Commit

Permalink
Refactor SessionMiddleware to share 'bag' variable in views
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmancuso committed Oct 25, 2024
1 parent 25693bc commit 35b3059
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/masonite/middleware/route/SessionMiddleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ def before(self, request, response):
# actually clears them out of the session
errors = Session.get("errors")
request.app.make("view").share({"errors": MessageBag(errors or {}).helper})
# TODO: remove this in Masonite 5
request.app.make("view").share({"bag": MessageBag(errors or {}).helper})
# if any errors then re-add them to the session
if errors:
Session.flash("errors", errors)
Expand Down

0 comments on commit 35b3059

Please sign in to comment.