I am new to nuxt and middleware and while I created a page and auth middleware which was working! I then deleted the test page and changed the redirect to an existing page as well as added a console.log message.
It seems that the middleware is cached somewhere because I am unable to see the changes that I made to the middleware js file and the redirect still tries to go to the deleted test page. I have tried in both SPA and Universal mode. I was able to create a new middleware that works which is why I think the original middleware is cached.
Am I correct that it is being cached and if so how can I clear it? (I have cleared my browser cache with no effect).
As I can see, you are using
auth
(maybe even auth.js) as a middleware. You might have thenuxt/auth
installed which claims that namespace for itself.If so I would remove auth/nuxt and retry if the middleware works properly as stated in the nuxtjs documentation:
https://nuxtjs.org/docs/2.x/directory-structure/middleware