DEV Community

Discussion on: How to make nuxt auth working with JWT - a definitive guide

 
mrnaif2018 profile image
MrNaif2018

Hmm, are you sure you have enabled auth middleware on that page?
Could you send a minimal snippet(repl.it, codesandbox, github/github gist or other sharing services) to reproduce that? I can look what is wrong.
Maybe try using built-in middleware and not the one from that post. In my situation it displays the page for a sec, and redirects to login page on client side. Probably custom middleware isn't needed anymore, I can't tell for sure as I am migrating to API tokens(randomly generated) with OAuth requests support and token revoking instead of JWT, it actually solved a loot of problems I had.

Thread Thread
 
mthnglac profile image
Metehan Gülaç

I tried the built-in middleware; it works smoothly in this scenario. I use django-rest-framework-simplejwt as the JSON Web Token authentication. We are probably using the same infrastructure.

Thread Thread
 
mrnaif2018 profile image
MrNaif2018

Yeah, same for now, at least both APIs are in python (;
But I am migrating from JWT for good, will write an article why, at least for now it seems better.