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

Jwt authentication nodejs #97

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Jwt authentication nodejs #97

wants to merge 16 commits into from

Conversation

tbedford
Copy link

No description provided.

Bruce Thomas and others added 6 commits July 21, 2022 17:45
- 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 <[email protected]>
[EDU-765] CHORES Jwt authentication nodejs fix
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));
Copy link
Member

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.

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

Successfully merging this pull request may close these issues.

5 participants