Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Grant access all controller to guest but private?

I'm have crated an app base on Invo but it has a problem in security plugin. If you enter any string after baseurl it will return this "You don't have access to this page". It happen because ditpatcher in security plugin will take care all route as valid url. So using route->notFound didn't work.

does anyone have a idea?



135
Accepted
answer
edited May '14

It's very simple. Instead of using beforeDispatch use beforeExecuteRoute:

public function beforeExecuteRoute(Event $event, Dispatcher $dispatcher)
{
    $auth = $this->session->get('auth');
    ...