title: Laravel Passport 401 Unauthorized Error using Apache and Vue
body: <p>i am trying to connect a generate a laravel user API using vue and laravel passport but i keep getting an authorization error in my headers . This ismy code </p>
  
  <pre><code>&lt;script&gt;
  import Hello from './components/Hello'
  
  export default {
    name: 'app',
  
    components: {
      Hello
    },
    created () {
      const postData = {
        grant_type: 'password',
        client_id: 2,
        client_secret: 'sXdg5nOO4UU2muiHaQnTq4hDQjyj17Kd9AeKuNEx',
        username: 'robertrutenge@gmail.com',
        password: 'password',
        scope: ''
  
      }
      this.$http.post('http://localhost:8000/oauth/token', postData)
  
     .then(response =&gt; {
       console.log(response)
  
       const header = {
         'Accept': 'application/json',
         'Authorization': ~'Bearer ' + response.body.access_token
       }
       this.$http.get('http://localhost:8000/api/user', {headers: header})
  
       .then(response =&gt; {
         console.log(response)
       })
     })
    }
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>I have done a research and most answers suggest modifying apache config file or .htaccess file but that also does not seem to work on my end . Any help will be appreciated :-)</p>