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: WIP Support Authentication in Realtime Subscriptions #8813

Closed
wants to merge 16 commits into from

Conversation

dthyresson
Copy link
Contributor

@dthyresson dthyresson commented Jul 2, 2023

  • can use @requireAuth to ensure an authenticated user can subscribe
    TODO:

  • docs

  • show example of authorization

const newMessage = {
  newMessage: {
    subscribe: (
      _,
      { roomId },
      {
        pubSub,
        currentUser,
      }: { pubSub: NewMessageChannelType; currentUser: Record<string, any> }
    ) => {
      if (currentUser || currentUser.id != '1234') {
        throw new ForbiddenError('no can do')
      }

HMM. I renamed a branch and this included files from #8791. I may redo this PR.

@dthyresson dthyresson added release:feature This PR introduces a new feature release:docs This PR only updates docs labels Jul 2, 2023
@dthyresson dthyresson added this to the v6.0.0 milestone Jul 2, 2023
@dthyresson dthyresson self-assigned this Jul 2, 2023
@dthyresson dthyresson removed the release:docs This PR only updates docs label Jul 3, 2023
@dthyresson
Copy link
Contributor Author

Closing in favor of #8815

@dthyresson dthyresson closed this Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:feature This PR introduces a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant