Skip to content

Commit

Permalink
Fixes #11, user_token Channel parameter is now set in the SetAuth
Browse files Browse the repository at this point in the history
… call.
  • Loading branch information
acupofjose committed Dec 25, 2021
1 parent d24e719 commit 32c5091
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Realtime/Channel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ private void HandleRejoinTimerElapsed(object sender, ElapsedEventArgs e)
Client.Instance.Options.Logger?.Invoke(Topic, "attempting to rejoin", null);

// Reset join push instance
JoinPush = new Push(this, Constants.CHANNEL_EVENT_JOIN, null);
JoinPush = new Push(this, Constants.CHANNEL_EVENT_JOIN, Parameters);

Rejoin();
}
Expand Down
5 changes: 4 additions & 1 deletion Realtime/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@ public void SetAuth(string jwt)
{
foreach (var channel in subscriptions.Values)
{
// See: https://github.com/supabase/realtime-js/pull/126
channel.Parameters["user_token"] = AccessToken;

if (channel.HasJoinedOnce && channel.IsJoined)
{
channel.Push(Constants.CHANNEL_ACCESS_TOKEN, new Dictionary<string, string>
Expand Down Expand Up @@ -296,7 +299,7 @@ public Channel Channel(string database = "realtime", string schema = null, strin

if (subscriptions.ContainsKey(key))
{
return subscriptions[key] as Channel;
return subscriptions[key];
}

var subscription = new Channel(database, schema, table, column, value, parameters);
Expand Down

0 comments on commit 32c5091

Please sign in to comment.