Skip to content

Conversation

@tbedford
Copy link

No description provided.

@fliptopbox fliptopbox force-pushed the jwt-authentication-nodejs branch from ff7043e to d7da718 Compare July 21, 2022 16:27
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 <mark.lewin@ably.com>
[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.

6 participants