With the scenario above, the router always resolves even when unauthenticated.
However what I’ve realised is that, when I comment out the component property in the route object, the beforeEnter hook works by calling the component inside the resolve({component: ContactPage}) method. This is tedious as I have to manually check this on every route, but then again impossible to have multiple hooks checks.
Whats funny is that, I’ve built the admin part of this app with vite + core, and it works perfectly fine.
on-load nothing will happend, there is no much sense to run beforeEnter-hook on initial page.
but, once you navigate (to any page), you won’t be able to navigate back (to home) [unless you resolve it]
here => headless-fire-uj2dfz - CodeSandbox
don’t do it.
How then do you check user auth status before displaying the index route which happens to be your Dashboard Page or Protected route?
I’ve achived this using F7-core with vite and its working fine.
In which case all pages except the Login Page receives a beforeEnter hook to check if user is logged in, resolve() else reject().