-
Notifications
You must be signed in to change notification settings - Fork 45
Jwt authentication nodejs #97
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
base: main
Are you sure you want to change the base?
Conversation
…utorials into jwt-authentication-nodejs
ff7043e
to
d7da718
Compare
- repaced old logo with static asset - replaced old UI with ably-ui like form - updated JavaScript to ES6 - Added missing package.json
Co-authored-by: Mark Lewin <mark.lewin@ably.com>
[EDU-765] CHORES Jwt authentication nodejs fix
Update README.md
server.js
Outdated
res.setHeader("Content-Type", "application/json"); | ||
|
||
console.log(": Sending signed JWT token back to client:\n%s", tokenId); | ||
res.send(JSON.stringify(tokenId)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we JSON-stringifying a string (which will just wrap it in quotes) and then setting an application/json
content-type? that makes no sense.
It looks like ably-js handles that because ably-js is very accommodating, but there's no guarantee any other sdk will.
We should send the string as a string, with a text/plain
or application/jwt
content-type.
Fix: don't JSON-encode JWT and update content type
No description provided.