Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security considerations with JWT being passed to the client #33

Closed
quantuminformation opened this issue Oct 1, 2019 · 2 comments
Closed

Comments

@quantuminformation
Copy link
Contributor

Why do we pass the JWT token to the client given that it is saved in the express-session? Maybe we could pass the sessionid to the client instead, and then do a comparison on that, and if it matches then proceed to use the token thats stored in express?

Passing to the client: (user contains the token) https://github.com/sveltejs/realworld/blob/master/src/routes/auth/register.js#L8

When we actually consume the token from the /auth folder we retrieve it from the express session, not the client:

https://github.com/sveltejs/realworld/blob/master/src/routes/auth/save.js#L6

maybe I'm missing something

Screenshot 2019-10-01 at 14 41 54

@quantuminformation
Copy link
Contributor Author

Ok, I see the point now, some requests are proxied through sapper and some go straight to the API, (ie in the articles). I think either it should be one way or the other to be more clear?

@quantuminformation
Copy link
Contributor Author

Closing as I decided as long as we are not storing the token in local storage then things should be ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant