[Answered ]-Vue JS Syntax error: "Unexpected Token, expected ,

1👍

Check the extra bracket you have in:

router.beforeEach((to, from, next) => {
  if (sessionStorage.getItem('authToken') !== null || to.path === '/auth') {
    next()
    }

  else {
    next('/auth')
    }
  }   <-----------
})

Please remove it, one tip use code editors, most of them will indicate this silly mistakes that you may not realize.

👤alphα

Leave a comment