I'm using nuxt
with apollo-module
and I need to intercept possible network errors (401/403's to be more specific) so I can show some error modal and log out my user. In the documentation I see that inside the nuxt.config.js
you can do like:
apollo: {
tokenName: 'Authorization',
authenticationType: 'Bearer',
errorHandler(error) { do something }
}
...
But inside that config file, I can't access the app features that I need (like a errors modal or my router, for instance). Is there any way to archive it?