You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the latest version of this package (4.3.7.2)
I just tried to create a small middleware to check if a user is authorized to do a certain action.
I was using SimpleRouter::request()->getLoadedRoute()->getParameters() inside the middleware to get the parameters from the route, but that failed since the value from getLoadedRoute() was null.
An easy fix would be to move Router.php line 408 ($this->request->addLoadedRoute($route);) up before the event EVENT_MATCH_ROUTE is triggered to make the loaded route available to the events. I haven't noted any negative side effects by making this change.
But the question is if this is 'by design' or if I should open a pull request?
Screen.Recording.2022-10-18.at.06.58.11.mov
The text was updated successfully, but these errors were encountered:
In this year I had no time to do the README.md and stuff like this, but I hope to make some time soon to also do some changes to the input validation topic. A lot was explained in #607 (validation) and a lot of changes were made to the InputHandler. If you have any questions, use this comment section.
I'm using the latest version of this package (4.3.7.2)
I just tried to create a small middleware to check if a user is authorized to do a certain action.
I was using
SimpleRouter::request()->getLoadedRoute()->getParameters()
inside the middleware to get the parameters from the route, but that failed since the value fromgetLoadedRoute()
was null.An easy fix would be to move Router.php line 408 (
$this->request->addLoadedRoute($route);
) up before the eventEVENT_MATCH_ROUTE
is triggered to make the loaded route available to the events. I haven't noted any negative side effects by making this change.But the question is if this is 'by design' or if I should open a pull request?
Screen.Recording.2022-10-18.at.06.58.11.mov
The text was updated successfully, but these errors were encountered: