axios-module icon indicating copy to clipboard operation
axios-module copied to clipboard

question about validateStatus on plugin

Open learntheropes opened this issue 3 years ago • 0 comments

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

learntheropes avatar Jan 04 '22 04:01 learntheropes