title: JWT authentication with AXIOS
body: <p>Using Vue webpack template, trying to make JWT authentication. What I've done so far:</p>
  
  <p>"src/auth/index.js":</p>
  
  <pre><code>  // Send a request to the login URL and save the returned JWT
    login (creds, redirect) {
      axios.post(LOGIN_URL, creds, (data) =&gt; {
        localStorage.setItem('access_token', data.access_token)
  
        this.user.authenticated = true
  
        // Redirect to a specified route
        if (redirect) {
          router.push(redirect)
        }
      }).error((err) =&gt; {
        context.error = err
      })
    },
  </code></pre>
  
  <p>I'm calling this function from LoginPage.vue:</p>
  
  <pre><code>  methods: {
      login () {
        var credentials = {
          username: this.credentials.username,
          password: this.credentials.password
        }
        // We need to pass the component's this context
        // to properly make use of http in the auth service
        auth.login(this, credentials, 'requests')
      }
    }
  </code></pre>
  
  <p>When I'm submitting the form, data is submitted, but I get the following error in a console:</p>
  
  <pre><code>TypeError: __WEBPACK_IMPORTED_MODULE_1_axios___default.a.post(...).error is not a function
  </code></pre>
  
  <p>Also JWT token is not saving in my local storage, what am I doing wrong?</p>