nuxt-community / axios-module

Secure and easy axios integration for Nuxt 2
https://axios.nuxtjs.org
MIT License
1.19k stars 245 forks source link

question about validateStatus on plugin #556

Open learntheropes opened 2 years ago

learntheropes commented 2 years ago

I have this code:

plugins/axios.js

export default ({ $axios }) => {
    $axios.defaults.validateStatus = (status) => {
        return status < 500
    }
}

nuxt.config.js

export default {
    plugins: [
        '~/plugins/axios.js'
    ]
}

Why I'm still getting error with status code 401? I can't use an instance because this status code is from a default request of nuxt-auth module