[Solved] V3 Router How to check if logged in everytime

Hello! I am currently checking if the user is logged in using the async property on routes, however I have a lot of different routes/subroutes. I am just using vanilla js, no frameworks.

It would help reduce clutter if there was a way to check if a user is logged in for branches of routes: e.g. check for all /secured/ routes and subroutes (/secured/page2 etc.)

As it stands currently I am using the async property on every route and subroute (e.g. /secured/ and /secured/page2).

Is there a way to do this? Thanks!

You can use routeBeforeEnter View’s parameter where you can check it http://framework7.io/docs/view.html#view-parameters. Or use beforeEnter on each route where you need it, check examples here http://framework7.io/docs/routes.html#route-before-enter-leave

Thank you very much! This is just what I was looking for.