[Vuejs]-Social authentication for Google failing with Vue.js and django-rest-auth

0👍

Ran into the same problem, the solution is quite easy but hard to found.

You need to add a tokenPath field to the configuration of the Vue-authenticate to allow vue to locate the token in the response.

In my case Django returns the token in ‘token’ field, but it may be different in your case.

Example code:

Vue.use(VueAuthenticate, {
  baseUrl: 'youApiDomain',
  storageType: 'localStorage',
  tokenPath: 'token',

  providers: {
    google: {
      clientId: 'yourClientId',
      redirectUri: '',
      url: 'authenticationUrl',
    }
  }
});

Solution found on: https://github.com/dgrubelic/vue-authenticate/issues/157#issuecomment-487063363

Leave a comment