i'm completely new to working with JWT and i'm struggling at a certain point:
with ajax requests i can set the authorization-header before the request...ok.
How do i use the JWT for "normal" requests? F.e. when reloading the page or simply following a link.
F.e. if a user isn't logged in, i want to redirect him to a landing-page.
On the server-side i have middleware that checks the JWT from the authorization-header and then either grants permission or redirects to the landing-page, but ofc currently i'm always getting the landing-page, because there's no authorization-header for non-ajax requests.
I'm storing the JWT in localstorage.
What am i missing?
Regards