You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to write my own custom NuxtJS module for pixie auth which uses Axios. The problem I have is that my custom module and plugin that lives inside of my module do not have access to Axios at all.
So the flow is this:
My custom module => registers my own plugin => in the plugin I would like to add an access token to each request and few more things...
importauthModulefrom'~/modules/pauth/src/store/modules/auth/auth.js'import{AuthService}from"~/modules/pauth/src/services/AuthService";importaxiosfrom'@nuxtjs/axios';exportdefault({ app, store, $axios},inject)=>{store.registerModule('auth',authModule,{preserveState: !!store.hasModule('auth')})inject('auth',newAuthService(store,'<%= JSON.stringify(options) %>'))app.router.beforeEach((to,from,next)=>{// const waitForStorageToBeReady = async (to, from, next) => {// await store.restored// }lettest=axios;console.log(test)// if user is logged in on the frontend check if the backend is ok// axios.post('is-logged').then(response => {// console.log(response)// })next()})}
Even when I use hooks and wait for all modules to load I can't seem to get that to work.
I tried looking up how nuxt/auth does that but no luck.
Could someone advise me what to do?
The text was updated successfully, but these errors were encountered:
Hello,
I am trying to write my own custom NuxtJS module for pixie auth which uses Axios. The problem I have is that my custom module and plugin that lives inside of my module do not have access to Axios at all.
So the flow is this:
My custom module => registers my own plugin => in the plugin I would like to add an access token to each request and few more things...
This is my module
This is my plugin
Even when I use hooks and wait for all modules to load I can't seem to get that to work.
I tried looking up how nuxt/auth does that but no luck.
Could someone advise me what to do?
The text was updated successfully, but these errors were encountered: