Skip to content

Support for Axios >= 0.23 & Typescript with common headers #357

Description

@Glandos

Describe the bug
Since Axios 0.23 and the inclusion of axios/axios#4140 types have changed for global headers.

It is now forbidden to set axios.defaults.headers.Authorization = 'Bearer {auth_token}' and it must be set in axios.defaults.headers.common instead.

However vue-auth-plugin skip non-strings value in

&& this.options.headerTokenReplace

Header is not replaced, and authenticated requests failed.

Expected behavior
Header should be replaced.

Additional context
Maybe the test should go deeper to handle common, get, post, etc, headers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions