I've started learning Node.js in the past few weeks, and I've finished a course of it. Sadly, the course didn't cover everything, this is why I came here.
So, the course covers the handling of JWT in the server side, but it didn't mention anything on the client side js, because they've used Postman. I understand everything, expect the fact that how can I store these tokens on the client, and how to send them with requests. I read things like the client side js stores it in a cookie or the localstorage. Okay, so if i were to store it in the localstorage, then I'd need to send it with every request, wouldn't I? If so, then it wouldn't be too efficent in my opinion. What if the client types an URL like www.example.com/somepage, and it requires authentication? In this example, he'd need to set it manually. Is there a way to automatically set the header after login?
Every tutorial or topic that i found about this doing it with postman.
Please don't sue me if this doesn't make any sense, I just want to clear things, because I'm confused a little bit.
Have a nice day!