Hello! I am trying to make an authentication system using phalcon's micro, with Controller handler. The system will generate a token at login and I need a middleware to check if the token is valid, but not on all routes. The register route should not be checked. I made an event listener and attached it.
$eventsManager = new Manager();
$eventsManager->attach('micro', new CheckTokenMiddleware());
$app->setEventsManager($eventsManager);
For routes I'm using micro collection.
$usersCollection = new \Phalcon\Mvc\Micro\Collection();
$usersCollection->setHandler('\App\Controllers\UserController', true);
$usersCollection->setPrefix('/user');
$usersCollection->post('/register', 'register');
$usersCollection->get('/([0-9]+)', 'get');
$app->mount($usersCollection);
How could I skip the register route when checking if token is valid?