Closed kikky7 closed 4 years ago
asking the same question...
you can remove vue-axios
and use just axios
then
Vue.prototype. axios = axios
or
Vue.use(VueAxios, axios)
Vue.use(VueSocialauth, {....})
VueSocialauth
make this.$auth
available in all your code you can call anyway since you Vue.use(VueSocialauth, {....})
in mean.js or app.js
I removed vue-axios which breaked following suggessted line:
Vue.use(VueAxios, axios)
and i got following error:
Error: Request handler instance not found
i assume the first statement should be something like
Vue.prototype.$http = axios
than i got rid of the "Request handler instance not found" issue but the request still can be processed: {err: Error: Request failed with status code 500}
how do you make your request share you code
AuthProvider(provider, event) {
event.preventDefault();
var self = this
this.$auth.authenticate(provider).then(response =>{
self.SocialLogin(provider,response)
}).catch(err => {
console.log({err:err})
})
},
SocialLogin(provider,response){
axios.post('/api/auth/'+provider,response).then(response => {
console.log(response.data)
}).catch(err => {
console.log({err:err})
})
}
this axios.post it should be this.axios.post
for some unknown reasons it works now for me, was maybe a caching issue...
thanks for help!!!
I am getting "Uncaught TypeError: Cannot set property 'axios' of undefined"
I have installed all the packages installed, and my app already uses "axiox" for AJAX calls
if comment out //Vue.use(VueAxios, axios)
The error no longer occurs, then I get Error: Request handler instance not found
//Here is what I added to my login component ![Uploading Screen Shot 2020-10-09 at 4.53.50 PM.png…]()
It's said it isn't strictly coupled to vue-axios, but there is only an example with vue-axios. How to use this package without it? While trying to console log this.$auth always returns Error: Request handler instance not found, since it required vue-axios wrapper. I use axios library and I don't need a wrapper for it.