We are building a bespoke forum in Flarum that must be inaccessible until a specific condition is met in the user model. While this condition isn't met, any HTTP requests are redirected to a route we have set up. However, the rest of the SPA is still accessible when links within it are clicked, which we don't want to be possible.
We currently have a custom middleware set up which redirects to a custom view in the SPA when entered in the URL, but due to the nature of the application, links can still be followed and the rest of the forum can still be accessed.
Is there a way to block routes in the front-end based on a condition in the user model?