Why do I need to do manual refresh of the realtime token? #37002
Unanswered
jbojcic1
asked this question in
Feature Requests
Replies: 3 comments 11 replies
|
You should probably consider a feature request as that is the way it is currently. |
0 replies
|
@GaryAustin1 ok, thx. I updated the category of this discussion to feature request. Is that enough or new one should be created? |
1 reply
|
After looking more into this, heartbeat is calling setAuth which ends up calling accessToken method but I think that in my case the problem is that after the app has been in a background for a bit the heartbeat stops so refreshed token is not set. |
10 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I am using custom auth with Supabase by using the accessToken method (see accessToken under options here). The code looks something like this:
My getJwtWithRefresh makes sure to refresh the token before it expires. In logs I see
accessToken method calledbeing logged every 5 or so seconds and everything works fine.However the issue is with supabase realtime. When the token expires and is refreshed, the realtime doesn't seem to be updated and it seems that I need to manually call
supabase.realtime.setAuth('fresh-token')after each refresh as described here. Why is that so? Couldn't Supabase handle that internally by detecting when accessToken method returns a new token and then callrealtime.setAuthinternally?All reactions