Closed filipecabaco closed 7 months ago
@filipecabaco what's the distinction between the tokens? How is Realtime server gonna use either?
Oh also need to do this in the Broadcast POST!
API Gateway requires anon or service role for the apikey.
What @chasers said. We need to emulate the following request:
const response = await fetch(channelUrl, {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${session?.access_token!}`,
apikey: process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
},
body: JSON.stringify({ name }),
});
added the same logic to HTTP Broadcast push
What kind of change does this PR introduce?
Handle properly jwt tokens as currently we were using only the apikey and that is not enough for scenarios with RLS policies.