Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interceptors #7

Closed
mdbetancourt opened this issue Nov 9, 2018 · 5 comments
Closed

Interceptors #7

mdbetancourt opened this issue Nov 9, 2018 · 5 comments

Comments

@mdbetancourt
Copy link
Contributor

How i can configure a interceptor for example refresh a token?

@nmihaica
Copy link

Axios is bundled with plugin
https://github.com/vuex-orm/plugin-axios/blob/master/src/orm/axios.js

Use wrapper methods to guide reponses accordingly
like

onResponse(response) {
  return response.data;
}

~

However, I agree that it should be enhancement if axios was dynamically injected with seperate instance. I think authors wanted to keep plugin simple and 'pluggable' with this approach.

@mdbetancourt
Copy link
Contributor Author

@nmihaica and how i can use an adapter like https://github.com/ctimmerm/axios-mock-adapter when need pass the axios instance

@nmihaica
Copy link

I would then stick with plain axios and axios-mock-adapter packages without vuex-orm.

@geogeorgiev
Copy link

It would be nice to have interceptors for adding a trailing slash as in this example axios/axios#757 (comment)

@ghost
Copy link

ghost commented Dec 5, 2018

I agree too. This would be nice, because currently I have other actions on my API that aren't CRUD and I already have the interceptor setup for the calls that pass by vanilla axios.
I wouldn't want to duplicate the logic in my interceptor and also in the custom hooks you defined for axios.

Please allow us to use the interceptor of axios itself!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants