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

fix: Don't send access token in rest broadcast #881

Merged
merged 2 commits into from
Apr 3, 2024
Merged

Conversation

Vinzent03
Copy link
Collaborator

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

The access token is sent as apikey, but from what I see it doesn't need/take authorization at all.

What is the new behavior?

The apikey passed in the default header in realtime client initialization in the supabase package is used. That's the anon apikey and not the user's one.

Additional context

I noticed that it was enough to remove the apikey field in the send method, because the apikey field gets also set in the AuthHttpClient if it's not already set, but I thought it's either way good to add it to the headers directly as well. realtime-js does this as well.

close #867

@Vinzent03 Vinzent03 changed the title fix: don't send access token in rest broadcast fix: Don't send access token in rest broadcast Apr 2, 2024
@Vinzent03 Vinzent03 requested a review from dshukertjr April 2, 2024 15:37
Copy link
Member

@dshukertjr dshukertjr left a comment

Choose a reason for hiding this comment

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

Looks great! 🙌

@Vinzent03 Vinzent03 merged commit 01a10c9 into main Apr 3, 2024
9 checks passed
@Vinzent03 Vinzent03 deleted the fix/broadcast branch April 3, 2024 08:18
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.

Invalid API key on sendBroadcastMessage method on realtime.
2 participants