[Vuejs]-Logout am I missing something?

0👍

One way to logout is to have a router link point to the login page as shown below (this can be either in your navigation or anywhere you have the option)

 <router-link to="/">Logout</router-link>

Then, in the router, have something like

 {
        path: "/login",
        name: "login",
        component: Thelogin,
        meta: {
          requiresAuth: false
        }
      },

So, everytime you are signing out, you will be re-directed to the login page, where authentication is not required.

Let me know if this helps, and if not, I can provide alternatives! 🙂

Leave a comment