title: Infinite loop with vue router beforeEach and children paths
body: <p>When i use beforeEach with children paths debug console show this error: vue-router.esm.js?8c4f:2079 RangeError: Maximum call stack size exceeded</p>
  
  <pre><code>import Vue from 'vue'
  import VueRouter from 'vue-router'
  import LoginMixin from '@/mixins/LoginMixin.js'
  
  Vue.use(VueRouter)
  
  const routes = [
    {
      path: '/',
      name: 'home',
      component: require('@/views/Home.vue').default,
    },
    {
      path: '/login',
      name: 'login',
      meta: { layout: 'centered' },
      component: () =&gt; import('@/views/Login.vue'),
    },
    {
      path: '/register',
      name: 'register',
      meta: { layout: 'centered' },
      component: () =&gt; import('@/views/Register.vue'),
      children: [
        {
          path: 'user',
          component: () =&gt; import('@/components/RegisterForm.vue'),
        },
        {
          path: 'company',
          component: () =&gt; import('@/components/CompanyForm.vue'),
        }
      ]
    },
  ]
  
  //creamos la instancia router modo history(urls amigables)
  const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
  })
  
  router.beforeEach((to, from, next) =&gt; {
    if (to.path != '/login' || to.path != '/register/user' &amp;&amp; LoginMixin.methods.loginMixinCheckAuth() == false) {
      //if not logead and join to other page distinc of login or register redirect to login
      next('/login')
    }
    else {
      next()
    }
  })
  </code></pre>
  
  <p>I dont know what is bad, the syntaxis is fine and function LoginMixin.methods.loginMixinCheckAuth() is working good (i tested without the function and result is the same).</p>