Closed k-ane closed 1 year ago
Doing some investigation seems this issue is related to line 403 of qrouter_controller.dart, since it only adds the MiddlewareController if the router has middleware.
I changed the line to this and it worked for me locally:
if (route.hasMiddleware || (QR.settings.globalMiddlewares.isNotEmpty && !route.isNotFound)) {
I set my global middlewares like so:
QR.settings.globalMiddlewares.add(AuthMiddleware());
When navigating around the app, the middleware never triggers.
However if I add to each route something like this:
middleware: [QMiddlewareBuilder()],
After doing that, my original global middleware starts working as expected.