I'm a beginner and I'm trying to implement JWT authentication for the first time. Right now, I am very confused and have a lot of questions, especially regarding the implementation part. I start off by listing the different queries I have, and hopefully the back and forth will give me a better insight into authentication. So, here goes.I saw people using Passport-jwt and Passport-Local strategies together. Why? I was under the impression that they do the same thing. If they are indeed different, how do they work together?2)Right now, I am able to send back the JWT from the backend to the front-end. Now, how/where do I store it (localstorage vs cookies - if cookies, how do I implement it? Am I right in assuming I will have to create a cookie extractor function for the Passport configuration code?), and how do I send this information back during future requests (how to conditionally check for the presence of the JWT, and only if present, set the Authorization header? Where do I set the authorization header, in the axios options object?) ?It's a bit fuzzy for me right now, and I can use some help.Thank you :)
Submitted September 03, 2020 at 06:13PM by NecroDeity
No comments:
Post a Comment