0

I am using JWT and i got my token from my spring api in a JS Var, now i need to set it as GET request header (like you do in post man) to render my endpoints (/someProtectedURL). 8 hours long and all i found in StackOverflow are imposible stuff, i need a vanilla or jquery way to do it, is just a little project :( some body saveeeeeeeeeeee me https://www.youtube.com/watch?v=6W_0E1QRx84

420root
  • 43
  • 7
  • You cannot add custom headers to a navigational GET (like clicking a link), but you can of course [easily](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#Headers) add them to an ajax/fetch call. So afaik, what you want to do is either impossible or trivially easy to find –  May 30 '20 at 07:44
  • yeah i alredy figured it out that for ajax request simple to set the headers. – 420root May 30 '20 at 07:48
  • Using JWT is not exactly esoteric, I'm sure there's a way to use the token that is actually possible. –  May 30 '20 at 07:51
  • yeah that kinda answer the question, i will look up for some frontend jwt framework or plugin or something, thx – 420root May 30 '20 at 07:54

0 Answers0