I have an Angular application that stores JWT tokens in localstorage to provide authentication. What I want to do is figure out how to grab this JWT token and insert it into an HTTP GET request, that renders as a completely new web page (NOT a returned object from an XMLHTTP request that displays in the same page...).मैं एक हाइपरलिंक (<a href> tag)
Is this possible? The only way I've found to do something similar would be to use basic HTTP authorization, such as:
username:[email protected]
And I'm assuming I could pass in my entire JWT there.
I'm using Express.js to handle routing on my Node.js backend.
है यही तो मैं क्या करने की कोशिश कर रहा हूँ से होने वाले एक HTTP GET अनुरोध के प्राधिकरण हैडर कैसे संपादित कर सकता। मैं कैसे टोकन हैडर में सम्मिलित करते हैं? – Leif
कि कमान मानक है $ http मॉड्यूल जो एक XMLHTTP अनुरोध खोलता है, और एक ऑब्जेक्ट देता है, सही? मैं एक पूरे नए पेज के लिए नियमित लिंक चाहता हूं। यदि संभव हो तो मैं इसे "?" पैरामीटर के रूप में यूआरएल में डालने से बचाना चाहता हूं – Leif
एक नियमित लिंक के साथ हेडर फ़ील्ड सेट नहीं करें। –