-
Notifications
You must be signed in to change notification settings - Fork 927
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
Allowing extending axios #98
Comments
@mathieutu We would appreciate a PR on this one, still if you don't have the time, we will try to fix it asap ;) |
ok, I'll do it when I get some time. |
@breakingrobot do you see any problem if instead of adding the plugin just after $axios we just push it at the end of plugins array and let the user choose the order? Why did you do this particular trick? - // ...add plugin just after $axios
- const index = this.options.plugins.findIndex(p =>
- /axios\.js$/.test(p.src || p)
- )
- this.options.plugins.splice(index + 1, 0, join(this.options.buildDir, dst))
+ // just push the plugin at the end
+ this.options.plugins.push(join(this.options.buildDir, dst)) Thanks for your answer. |
@mathieutu But we can't add it to the end. Users may provide plugins to extend auth too (just like axios) (thus depend on it). Update: now auth uses |
Sounds perfect for me! |
Hi.
I've spent several hours to understand why my axios default config (added in
~/plugins/axios.js
as explained here) were not applied whenfetchUser
was called, at the app init.In fact, you add the auth plugin just after the first axios plugin, so it inits before the config file:
auth-module/lib/module.js
Lines 93 to 96 in ca8785f
With that, I can't use this module at all, because all the axios config I need (especially x-api-key header) is set after the auth plugin.
😞
Do you have any quick solution, or do you want a PR?
The text was updated successfully, but these errors were encountered: