I have a script that will redirect a user to the login screen when they get a response code of 401 - which means their session has expired within the API.
import
Make sure you already installed vue router. If not yet, this is how to install
npm install vue-router // npm
or vue router cdn
When used with a module system, you must explicitly install the router via Vue.use(). Do this one
import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
then redirect to other page like this
this.$router.push({ name: 'nome-of-location'})