-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use vuex-rest-api with nuxt.js auth-module #78
Comments
Yes. It works with Nuxt. |
@christianmalek sorry I was not ready with the descriotion. I have an issue in conbination with nuxt-auth as the axios instance can`t be passed. At lease I don't know how. |
Could you please provide a link to nuxt-auth? |
sure added it to the description, ment auth-module and not nuxt-auth... |
currently I am at the state of having something ugly like this:
with that I still have to call that on the client to instantiate the module with the correct axios instance
|
found a solution for now: I can register it by using the plugins/init-store-modules.js
store/index.js
You could also register that inside the plugin but I like to have the module registration inside the store. @christianmalek Maybe that should be added to the readme with an example or similar. |
Hey @appinteractive ! I've just tried 30min to make the axios instance accessible to vuex-rest-api in combination with nuxt-auth (which uses nuxt-axios) and didn't find any solution. I didn't think about registering the store with an action. Nice idea! At the moment I also don't know how I could simplify this process. Do you have any ideas? I will definitely add this to the readme. Thanks! |
@christianmalek I think you could provide your package as a nuxt module, but that I would not know how to register the stores in a sane way. |
I will look into this. But I don't have much experience with nuxt. |
@appinteractive I've added an section: https://christianmalek.github.io/vuex-rest-api/miscellaneous.html#nuxt |
Yeah thanks for mentioning 😀 |
@christianmalek New Update: store/index.js
store/posts.js
|
Hello @juandl ! The issue was passing a specific axios instance to Vapi. Does this work with your code? |
Hello @christianmalek, I had the same problem in Huxt.js in this way I solved it. |
@juandl But you don't pass any specific axios instance in your code example which was necessary for nuxt-auth @appinteractive, doesn't it? So how does this work? |
Hey I have the following issue...
I need nuxt auth-module to work with that package but at the point of creation I cant pass any axios instance, and thre is no global one. The result is that I get 401 response as I cant use the correct axios instance with the auth logic. Any idea?
in Nuxtj.s I create a store
users store
The text was updated successfully, but these errors were encountered: