Access router instance from my service : <p>I create a auth service (<code>src/services/auth.js</code>), with just functions and properties ..</p>

<pre><code>export default {
    login() { ... }
    ...
}
</code></pre>

<p>Inside <code>login</code> function, I need to redirect user </p>

<pre><code>router.go(redirect)
</code></pre>

<p><strong>How can I retrieve router instance</strong>?</p>

<hr>

<h3>Context</h3>

<p>In my <code>src/main.js</code> file, i create a router ..</p>

<pre><code>import VueRouter from 'vue-router'
Vue.use(VueRouter)
import route from './routes'
const router = new VueRouter({
  history: false,
  linkActiveClass: 'active'
})
route(router)

const App = Vue.extend(require('./App.vue'))
</code></pre>

<p>In my <code>src/routers.js</code> is just map routes</p>

<pre><code>export default function configRouter (router) {
    router.map({ .. })
}
</code></pre>
