[Vuejs]-Probleme router with localstorage password

0👍

You always redirect user here next('login') and call before each once and once again.

To solve that you need to rewrite your beforeEach logic:

  if (to.name === 'login') {
    next()
  } else if (!localStorage.passwordEm) {
  ...

Leave a comment