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
- [Vuejs]-How do I pass a dependency to a Vue component?
- [Vuejs]-Vue App, need styles to be added above other styles
Source:stackexchange.com