isAuthenticated in Vue router

I have followed the instructions here https://github.com/auth0/auth0-vue/blob/main/EXAMPLES.md#accessing-auth0client-outside-of-a-component to access the auth0 client from Vue Router and that seems to work, except that most of the time isAuthenticated is false. The rest of the app works fine, including using isAuthenticated from within Vue files, except that isAuthenticated is showing as a Ref and I have had to use isAuthenticated.value to get it to work.

I found this: https://community.auth0.com/t/access-auth0-object-in-the-vue-router/65299 but it seems to be referencing files that no longer exist in that example.

Is there a current example that shows how to use auth0 from the Vue router?

I’ve included the code from my router file where I was trying to use isAuthenticated. It only seems to evaluate to true just after I log in when it redirects (though I’m not 100% certain of that), but when I click on a link after that it seems to be false again, even though the rest of the website is behaving as if I’m logged in.

router.beforeEach((to, from, next) => { 
  if (auth0.isAuthenticated.value === true) {    
    if (to.name == 'home') {      
      next('/user-account')
    }
    else {
      next()
    }
  }
  else {
    next()
  }
  
});