Nuxt Axios interceptors not working when Axios plugin is in Auth plugin option. #1612
Replies: 8 comments
-
Thanks for reporting! We're focused on the v5 branch now - is the issue present if you use |
Beta Was this translation helpful? Give feedback.
-
@bmulholland yes, I've forked the sandbox > https://codesandbox.io/s/condescending-dawn-54w9d and updated the nuxt auth package to nuxt auth-next and it's the same issue. The console log in the axios plugin is not reached when the plugin is added to the auth plugins, but is reached when added to the global nuxt plugins option. One thing, in the forked sandbox you might need to reload the page to see the console log after you've logged in to facebook (when you added the axios plugin to the nuxt global plugin option). |
Beta Was this translation helpful? Give feedback.
-
This is still an issue. Is there a solution now? |
Beta Was this translation helpful? Give feedback.
-
I am also experiencing the same issue, which is leading to issues processing the potential errors that are catched in the onError call. Is there a possible work around for the time being? |
Beta Was this translation helpful? Give feedback.
-
Hey all - apologies, I simply don't have bandwidth to look into this right now. Any debugging and/or fixes you can come up with can be express reviewed, though. |
Beta Was this translation helpful? Give feedback.
-
Any fix on this? Also experiencing this issue. |
Beta Was this translation helpful? Give feedback.
-
@pawmanaloto Your investigation and PR are welcomed :) |
Beta Was this translation helpful? Give feedback.
-
Axios was recently upgraded -- does that help with this issue? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Version
auth: 4.9.1
axios: 5.12.2
nuxt: 2.14.6
Nuxt configuration
mode:
Nuxt configuration
Reproduction
https://codesandbox.io/s/lively-tree-b84o6
What is expected?
When adding the axios.js plugin to the auth plugin option the axios interceptors should catch the request/response.
What is actually happening?
When the axios.js plugin is added to the global nuxt plugin option the axios intercepters catch the request/response. When the plugin is added to the auth plugin option the axios interceptors do not get triggered.
Steps to reproduce
1:
Go to the sandbox: https://codesandbox.io/s/lively-tree-b84o6?
Open console
Login using the Facebook button
See that there is no response/request logging:
2:
In nuxt.config.js comment out line: 33 (auth plugin)
Uncomment line: 44 (nuxt global plugin)
Open console
Login using the Facebook button
See that there is response/request logging:
Additional information
Checklist
Due to reasons I cannot upgrade nuxt, auth and axios.
What is expected?
Axios interceptors should work when added to the auth plugin option
Beta Was this translation helpful? Give feedback.
All reactions