am new to nuxtjs vuex and axios as my project getting bigger i choose to build with nuxt/axios and nuxt/auth but after loginedin when i go to jwt protected route from my api its showing me error 401. then i try to use axios module Interceptors to send auth user token in the header using bearer token.
inside '~/plugins/axios'
export default function ({ $axios, redirect }) {
$axios.onRequest(config => {
this.$axios.setToken('123', 'Bearer')
})
}
inside 'store.js'
export const actions = {
async load_cdata ({commit}, url){
const {data} = await axios.get(url)
commit('setData', data)
},
then i get error
_plugins_axios__WEBPACK_IMPORTED_MODULE_3__.default.get is not a function
PLEASE ANY ONEWHO KNOW HOW TO USE NUXT/AXIOS MODULE INTERCEPTORS WITH NUXTJS
This issue as been imported as question since it does not respect axios-module issue template. Only bug reports and feature requests stays open to reduce maintainers workload.
If your issue is not a question, please mention the repo admin or moderator to change its type and it will be re-opened automatically.
Your question is available at https://cmty.app/nuxt/axios-module/issues/c202.
Why was this issue closed?
What was the solution?