Skip to content

Allowing extending axios #98

@mathieutu

Description

@mathieutu

Hi.
I've spent several hours to understand why my axios default config (added in ~/plugins/axios.js as explained here) were not applied when fetchUser 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:

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))

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?

This question is available on Nuxt.js community (#c71)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions