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

feat(token): ensure auth provides correct response & token has actor #347

Merged
merged 17 commits into from
Jun 16, 2022

Conversation

FlowFlorent
Copy link
Collaborator

@FlowFlorent FlowFlorent commented Jun 15, 2022

Related PR: https://github.com/liveblocks/liveblocks.io/pull/261

  • Ensures auth provides correct response format by including the token
  • Improves the error message when validating that the token is for a room
  • Adds related tests

Related issue: #331

Copy link
Collaborator

@nvie nvie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, @FlowFlorent ! 🙌

}
}

// TODO: unused in all packages & not accessible from @liveblocks/client users, remove?
Copy link
Collaborator

@nvie nvie Jun 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha! Great catch, I think you're right. It's good to also always check usage of these APIs in https://github.com/liveblocks/liveblocks-cloudflare and https://github.com/liveblocks/liveblocks.io, because those might also import these APIs using import { parseAuthToken } from "@liveblocks/client/internal" (I learned this the hard way!), but I just checked them and they're also not using this anymore either!

I think what happened is that at the end of some refactorings, we ended up with only usages of parseRoomAuthToken, and never this one anymore, and I forgot to clean this one up. I think it would indeed be safe to remove this — nice! ✨🧽✨

packages/liveblocks-client/src/AuthToken.ts Outdated Show resolved Hide resolved
packages/liveblocks-client/src/AuthToken.ts Outdated Show resolved Hide resolved
FlowFlorent and others added 2 commits June 16, 2022 17:09
Co-authored-by: Vincent Driessen <me@nvie.com>
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

Successfully merging this pull request may close these issues.

None yet

3 participants