title: How to disable access to login and signup page when user is logged in?
body: <p>i am confused why is this not working.</p>
  
  <p><strong>Routes</strong></p>
  
  <pre><code>const router = new VueRouter({
    mode: 'history',
    routes: [
        { path: '/', component: Home,  name: 'Home', meta: { requiresAuth: true }},
        { path: '/adminarea', component: Admin, name:"Admin", meta: { requiresAuth: true }},
        { path: '/login', component: Login, name: 'Login'},
        { path: '/signup', component: Register,  name: 'Signup'},
    ]
  });
  
  router.beforeEach((to, from, next) =&gt; {
    if (to.matched.some(record =&gt; record.meta.requiresAuth)) {
      // this route requires auth, check if logged in
      // if not, redirect to login page.
      if (!store.getters.getAuth) {
        next({ name: 'Login' })
      } else {
         next();
      }
    } else {
      next()
    }
  </code></pre>
  
  <p>});</p>
  
  <p><strong>to.matched.some(record => record.meta.requiresAuth</strong> this line should allow only routes with meta requiresAuth but i don't know why is it allowing other routes as well.</p>
  
  <p>I can manually access login and signup pages.
  I cannot figure out what is wrong here.</p>