How to send jwt token from expressjs to react application?

I want to send the jwt token from the expressjs router to react application.

I using google-passport to login. For login, react app is redirecting it to the server and once server authenticates the user, it redirects back to the react app.

Sending token in the query is not a good option.

What are the other secure options to send the token?

Node server running on 8080 while react app is running on 3000.

I am using express-session to maintain the session. Don't know if it can be used for this. And how to read this session from the react app.


Read more here:

Content Attribution

This content was originally published by Shubham Chadokar at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: