title: Laravel pass Auth to vue SPA
body: <p>I have a laravel + vue app. the authentication is managed fully using laravel Auth and blades. Now I'm building a vue application inside the system. This vue app is integrated with vue-router and vuex. Im using Api controller for any http request from my vue aplication.</p>
  
  <p>app.js</p>
  
  <pre><code>Vue.use(VueRouter);
  
  global.router = new VueRouter({
      base: window.location.pathname.replace(/^(\/c\/[^\/]+).*/i,'$1'),
      routes: routes
  });
  
  new Vue({
      el: '#spa',
      render: h =&gt; h(App),
      router,
      store: store,
  });
  </code></pre>
  
  <p>Everything else is working good except on how to pass Auth data from laravel to vue. And how to auto log out the user if user is logged out from the main laravel system. Is there any solution or workaround to this?</p>
  
  <p>Thanks</p>